mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #5996 from s0undt3ch/issues/5989-old-style-classes-and-__new__
Let's make `SaltLoggingClass` a new style class. Fixes #5989.
This commit is contained in:
commit
d21c005058
@ -71,7 +71,9 @@ def is_temp_logging_configured():
|
||||
if sys.version_info < (2, 7):
|
||||
# Since the NullHandler is only available on python >= 2.7, here's a copy
|
||||
class NullHandler(logging.Handler):
|
||||
""" This is 1 to 1 copy of python's 2.7 NullHandler"""
|
||||
'''
|
||||
This is 1 to 1 copy of python's 2.7 NullHandler
|
||||
'''
|
||||
def handle(self, record):
|
||||
pass
|
||||
|
||||
@ -136,7 +138,7 @@ class LoggingMixInMeta(type):
|
||||
)
|
||||
|
||||
|
||||
class SaltLoggingClass(LOGGING_LOGGER_CLASS):
|
||||
class SaltLoggingClass(LOGGING_LOGGER_CLASS, object):
|
||||
__metaclass__ = LoggingMixInMeta
|
||||
|
||||
def __new__(cls, logger_name):
|
||||
@ -239,7 +241,7 @@ if logging.getLoggerClass() is not SaltLoggingClass:
|
||||
|
||||
# Add a Null logging handler until logging is configured(will be
|
||||
# removed at a later stage) so we stop getting:
|
||||
# No handlers could be found for logger "foo"
|
||||
# No handlers could be found for logger 'foo'
|
||||
logging.getLogger().addHandler(LOGGING_NULL_HANDLER)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user