Browse Source

[cdist.emulator] Fix setting of log level (tests OK)

bugfix/in-script-import
Dennis Camera 2 years ago
parent
commit
c39eb1dbce
  1. 5
      cdist/emulator.py

5
cdist/emulator.py vendored

@ -120,17 +120,18 @@ class Emulator:
level = logging.WARNING
else:
level = logging.WARNING
self.log = logging.getLogger(self.target_host[0])
try:
logging.root.setLevel(level)
self.log.setLevel(level)
except (ValueError, TypeError):
# if invalid __cdist_log_level value
logging.root.setLevel(logging.WARNING)
self.log.setLevel(logging.WARNING)
colored_log = self.env.get('__cdist_colored_log', 'false')
cdist.log.CdistFormatter.USE_COLORS = colored_log == 'true'
self.log = logging.getLogger(self.target_host[0])
def commandline(self):
"""Parse command line"""

Loading…
Cancel
Save