Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove calls to logging.addLevelName() for existing log levels #281

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

talber-nvidia
Copy link
Contributor

Calling logging.addLevelName() for existing log levels overrides the original values in Python's logging module, which then makes it incompatible with log levels assumed by SysLogHandler, see logging.handlers.SysLogHandler.priority_map.
This causes unexpected behavior when using SysLogHandler, basically making it print all messages to syslog with loglevel warning.
This fixes the log level inconsistency in messages such as:

WARNING info: eth0: enabling syslog for dhcp configuration
WARNING info: executing /bin/ip ...
WARNING info: executing /sbin/dhclient ...

Calling logging.addLevelName() for existing log levels overrides the
original values in Python's logging module, which then makes it
incompatible with log levels assumed by SysLogHandler.
This causes unexpected behavior when using SysLogHandler, basically
making it print all messages to syslog with loglevel warning.
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