Skip to content

Clean up config logging#19957

Draft
seanbudd wants to merge 3 commits intobetafrom
cleanUpConfigLogging
Draft

Clean up config logging#19957
seanbudd wants to merge 3 commits intobetafrom
cleanUpConfigLogging

Conversation

@seanbudd
Copy link
Copy Markdown
Member

@seanbudd seanbudd commented Apr 16, 2026

Link to issue number:

None

Summary of the issue:

  • Config files would get logged at info level if they were invalid.
  • Converting loglevel name strings to integers via getLevelName is deprecated

Description of user facing changes:

Description of developer facing changes:

Description of development approach:

Testing strategy:

Known issues with pull request:

  • log.debug will never get logged during initialization, meaning there is no easy way to decide whether or not to log config when it fails to load.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Comment thread source/config/__init__.py
# Log at level info to ensure that the profile is logged.
log.info("Config before schema update:\n%s" % profileCopy, exc_info=False)
# Log at level debug to ensure that the profile isn't logged by default.
log.debug("Config before schema update:\n%s" % profileCopy, exc_info=False)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this will never log at debug level on systems, as setting the log level from config hasn't happened yet, so the python default level (info) is being used.
We should avoid logging config by default, but that doesn't give good debug steps. Instead should we create a back up?

Comment thread source/config/__init__.py Outdated
@seanbudd seanbudd added this to the 2026.1 milestone Apr 16, 2026
@seanbudd
Copy link
Copy Markdown
Member Author

Blocking on the more useful #19966 while we decide what the behaviour should be here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant