[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
|
level = logging.WARNING
|
||||||
else:
|
else:
|
||||||
level = logging.WARNING
|
level = logging.WARNING
|
||||||
|
self.log = logging.getLogger(self.target_host[0])
|
||||||
try:
|
try:
|
||||||
logging.root.setLevel(level)
|
logging.root.setLevel(level)
|
||||||
|
self.log.setLevel(level)
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
# if invalid __cdist_log_level value
|
# if invalid __cdist_log_level value
|
||||||
logging.root.setLevel(logging.WARNING)
|
logging.root.setLevel(logging.WARNING)
|
||||||
|
self.log.setLevel(logging.WARNING)
|
||||||
|
|
||||||
colored_log = self.env.get('__cdist_colored_log', 'false')
|
colored_log = self.env.get('__cdist_colored_log', 'false')
|
||||||
cdist.log.CdistFormatter.USE_COLORS = colored_log == 'true'
|
cdist.log.CdistFormatter.USE_COLORS = colored_log == 'true'
|
||||||
|
|
||||||
self.log = logging.getLogger(self.target_host[0])
|
|
||||||
|
|
||||||
def commandline(self):
|
def commandline(self):
|
||||||
"""Parse command line"""
|
"""Parse command line"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue