Repository navigation
Log a startup banner with the effective log level + config path - #11
Merged
Merged
Conversation
Make logging configuration self-diagnosing: after setup_logging configures the loggers it now emits one INFO line showing the effective level, its source (log_level=... vs --debug), and the exact config file that was loaded (or "(no config file found)"). This makes it immediately obvious whether log_level from mcbot.conf took effect and which file was read. - Config.config_path records the loaded config file (None if none found). - load_config sets it when it reads the file. - setup_logging emits the banner at INFO (visible in the default config and the common "expected DEBUG, got INFO" case, without polluting logs). - tests/test_logging.py: assert config_path is recorded and the banner reports the level + path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes logging configuration self-diagnosing. After
setup_loggingconfigures the loggers, it emits one INFO line:It shows the effective level, its source (
log_level=…from the config vs the--debugflag), and the exact config file that was loaded — orconfig=(no config file found)when none was read.Why
This is a follow-up to the
log_level/--debugfix (#10). When debug logging "doesn't work," the cause is almost always environmental — stale deployed code, the wrong working directory, or a config file that isn't the one being edited. This banner surfaces all of that at startup: if it printsINFOwhen you setDEBUG, or aconfig=path you didn't expect (or "no config file found"), you immediately know whether it's the code, the level, or the wrong/missing conf.Changes
Config.config_path— records the config file actually loaded (Noneif none found).load_configsets it when it finds and reads the file.setup_loggingemits the banner at INFO (visible in the default config and the common "expected DEBUG, got INFO" case, without polluting logs at WARNING+).tests/test_logging.py— assertconfig_pathis recorded and the banner reports the effective level + path.Testing
tests/test_logging.pypasses (incl. the new banner/config_path checks);test_repeat_tracking.pyandtest_radio_eviction.pystill pass;py_compileclean. Verified the banner output for three cases: config withDEBUG, no config file (defaults), and--debugoverride.🤖 Generated with Claude Code