Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set_level(self):
# Set the level of the logging system
pref = self.preferences_dialog.ui
level = pref.preferences_options_general_logging_value.currentText()
level = getattr(colorlog.logging.logging, level)
colorlog.getLogger().setLevel(level)
def basicConfig(**kwargs):
"""Call ``logging.basicConfig`` and override the formatter it creates."""
logging.basicConfig(**kwargs)
logging._acquireLock()
try:
stream = logging.root.handlers[0]
stream.setFormatter(
ColoredFormatter(
fmt=kwargs.get('format', BASIC_FORMAT),
datefmt=kwargs.get('datefmt', None)))
finally:
logging._releaseLock()
def basicConfig(**kwargs):
"""Call ``logging.basicConfig`` and override the formatter it creates."""
logging.basicConfig(**kwargs)
logging._acquireLock()
try:
stream = logging.root.handlers[0]
stream.setFormatter(
ColoredFormatter(
fmt=kwargs.get('format', BASIC_FORMAT),
datefmt=kwargs.get('datefmt', None)))
finally:
logging._releaseLock()