CumulusNetworks / ifupdown2

GNU General Public License v2.0
161 stars 75 forks source link

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

Open talber-nvidia opened 1 year ago

talber-nvidia commented 1 year ago

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 ...