diff options
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-rwxr-xr-x | bitbake/bin/bitbake-layers | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index 66fc7ca21f..390ad0503d 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers | |||
@@ -30,26 +30,9 @@ topdir = os.path.dirname(bindir) | |||
30 | sys.path[0:0] = [os.path.join(topdir, 'lib')] | 30 | sys.path[0:0] = [os.path.join(topdir, 'lib')] |
31 | 31 | ||
32 | import bb.tinfoil | 32 | import bb.tinfoil |
33 | import bb.msg | ||
33 | 34 | ||
34 | def logger_create(name, output=sys.stderr): | 35 | logger = bb.msg.logger_create('bitbake-layers', sys.stdout) |
35 | logger = logging.getLogger(name) | ||
36 | loggerhandler = logging.StreamHandler(output) | ||
37 | loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) | ||
38 | logger.addHandler(loggerhandler) | ||
39 | logger.setLevel(logging.INFO) | ||
40 | return logger | ||
41 | |||
42 | def logger_setup_color(logger, color='auto'): | ||
43 | from bb.msg import BBLogFormatter | ||
44 | console = logging.StreamHandler(sys.stdout) | ||
45 | formatter = BBLogFormatter("%(levelname)s: %(message)s") | ||
46 | console.setFormatter(formatter) | ||
47 | logger.handlers = [console] | ||
48 | if color == 'always' or (color == 'auto' and console.stream.isatty()): | ||
49 | formatter.enable_color() | ||
50 | |||
51 | |||
52 | logger = logger_create('bitbake-layers', sys.stdout) | ||
53 | 36 | ||
54 | def main(): | 37 | def main(): |
55 | parser = argparse.ArgumentParser( | 38 | parser = argparse.ArgumentParser( |
@@ -74,7 +57,9 @@ def main(): | |||
74 | elif global_args.quiet: | 57 | elif global_args.quiet: |
75 | logger.setLevel(logging.ERROR) | 58 | logger.setLevel(logging.ERROR) |
76 | 59 | ||
77 | logger_setup_color(logger, global_args.color) | 60 | # Need to re-run logger_create with color argument |
61 | # (will be the same logger since it has the same name) | ||
62 | bb.msg.logger_create('bitbake-layers', output=sys.stdout, color=global_args.color) | ||
78 | 63 | ||
79 | plugins = [] | 64 | plugins = [] |
80 | tinfoil = bb.tinfoil.Tinfoil(tracking=True) | 65 | tinfoil = bb.tinfoil.Tinfoil(tracking=True) |