summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/scriptutils.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index 3c60c3a1e6..0633c7066e 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -39,12 +39,12 @@ def logger_create(name, stream=None):
39 39
40def logger_setup_color(logger, color='auto'): 40def logger_setup_color(logger, color='auto'):
41 from bb.msg import BBLogFormatter 41 from bb.msg import BBLogFormatter
42 console = logging.StreamHandler(sys.stdout) 42
43 formatter = BBLogFormatter("%(levelname)s: %(message)s") 43 for handler in logger.handlers:
44 console.setFormatter(formatter) 44 if (isinstance(handler, logging.StreamHandler) and
45 logger.handlers = [console] 45 isinstance(handler.formatter, BBLogFormatter)):
46 if color == 'always' or (color=='auto' and console.stream.isatty()): 46 if color == 'always' or (color == 'auto' and handler.stream.isatty()):
47 formatter.enable_color() 47 handler.formatter.enable_color()
48 48
49 49
50def load_plugins(logger, plugins, pluginpath): 50def load_plugins(logger, plugins, pluginpath):
@@ -69,6 +69,7 @@ def load_plugins(logger, plugins, pluginpath):
69 plugin.plugin_init(plugins) 69 plugin.plugin_init(plugins)
70 plugins.append(plugin) 70 plugins.append(plugin)
71 71
72
72def git_convert_standalone_clone(repodir): 73def git_convert_standalone_clone(repodir):
73 """If specified directory is a git repository, ensure it's a standalone clone""" 74 """If specified directory is a git repository, ensure it's a standalone clone"""
74 import bb.process 75 import bb.process