[UX] Add option to enable LogLevel-based coloured output.
This makes it easier for new and experienced users to run cdist with higher verbosity levels, both to know that things are working as expected and to debug issues. Documentation has been modified accordingly and default behaviour is not changed.
This commit is contained in:
parent
988190363a
commit
ba77ea9edc
9 changed files with 140 additions and 18 deletions
|
|
@ -129,6 +129,9 @@ class Emulator(object):
|
|||
# if invalid __cdist_log_level value
|
||||
logging.root.setLevel(logging.WARNING)
|
||||
|
||||
colored_log = self.env.get('__cdist_colored_log', 'False')
|
||||
cdist.log.ColorFormatter.USE_COLORS = colored_log == 'True'
|
||||
|
||||
self.log = logging.getLogger(self.target_host[0])
|
||||
|
||||
def commandline(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue