<#3080 fix: Delay setting up console logging until...
# meltano-repo-activity
g
#3080 fix: Delay setting up console logging until the CLI is invoked and test log output snapshots Pull request opened by edgarrmondragon 1. Using
logging.config.dictConfig
was interfering with the Pytest
caplog
fixture. See • pytest-dev/pytest#10606 ## Summary by Sourcery Refactor console logging to initialize only when the CLI is invoked by extracting setup into a new logging module, update plugin base and metrics handling accordingly, and migrate tests to use pytest caplog for log assertions. Bug Fixes: • Fix CLI config validation tests to capture error messages via pytest caplog instead of stderr Enhancements: • Extract console logging setup into singer_sdk._logging._setup_console_logging and defer its execution until CLI startup • Allow metrics logger level to be configured dynamically from plugin settings during initialization • Update the reader completion log message to include activate version counts Tests: • Migrate core and sample tests to use caplog for log capturing and adjust log filter settings • Update log snapshot files to use singer.log and remove deprecated stderr snapshots Chores: • Remove legacy _setup_logging and YAML config loader from singer_sdk.metrics • Suppress redundant stream alias logging in sample mapper ## Summary by Sourcery Defer console logging configuration until the CLI is invoked by extracting it into a new module, refactor metric logging to use inline JSON and dynamic log levels, update reader logs to include activate version counts, deprecate legacy formatter and setup routines, and migrate tests and snapshots to use pytest caplog for log assertions. New Features: • Allow metrics log level to be configured dynamically from plugin settings during initialization Bug Fixes: • Delay console logging setup to avoid interference with pytest caplog fixture • Fix CLI config validation tests to capture error messages via pytest caplog instead of stderr • Capture record validation warnings via caplog instead of stderr Enhancements: • Extract console logging setup into singer_sdk._logging._setup_console_logging and defer execution until CLI startup • Refactor metric logging to include JSON-formatted points inline and deprecate SingerMetricsFormatter • Update reader completion log to report activate version message counts • Remove deprecated logging setup and YAML config loader from metrics module Documentation: • Update logging documentation example to remove redundant message field Tests: • Migrate core and sample tests to use caplog for log capturing and add log filters • Update log snapshot files to use singer.log and remove deprecated stderr-based snapshots Chores: • Suppress redundant stream alias logging in sample mapper meltano/sdk