forked from ungleich-public/cdist
[cdist.emulator] Fix setting of log level (tests OK)
This commit is contained in:
parent
0ee3fda94d
commit
c39eb1dbce
1 changed files with 3 additions and 2 deletions
|
@ -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…
Reference in a new issue