summaryrefslogtreecommitdiffstats
path: root/bin/bitbake-dumpsig
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-03-27 13:17:27 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-27 11:10:37 +0100
commitb1ba7d1cc8ec33e2d081230287abd07f52136097 (patch)
treebfff3686284f88d93a1b18ae8aeeffefaad40206 /bin/bitbake-dumpsig
parentff1ccd1db5d70b3fc9ad0d3e8f3d7b804c22bf36 (diff)
downloadbitbake-b1ba7d1cc8ec33e2d081230287abd07f52136097.tar.gz
lib/bb/msg: introduce logger_create() function
We use this code to set up a logger with colour in a number of different places, so create one function that does this and make some of bitbake's utility scripts use it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake-dumpsig')
-rwxr-xr-xbin/bitbake-dumpsig14
1 files changed, 2 insertions, 12 deletions
diff --git a/bin/bitbake-dumpsig b/bin/bitbake-dumpsig
index 38efd2286..95ebd9354 100755
--- a/bin/bitbake-dumpsig
+++ b/bin/bitbake-dumpsig
@@ -29,19 +29,9 @@ sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), '
import bb.tinfoil
import bb.siggen
+import bb.msg
-def logger_create(name, output=sys.stderr):
- logger = logging.getLogger(name)
- console = logging.StreamHandler(output)
- format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
- if output.isatty():
- format.enable_color()
- console.setFormatter(format)
- logger.addHandler(console)
- logger.setLevel(logging.INFO)
- return logger
-
-logger = logger_create('bitbake-dumpsig')
+logger = bb.msg.logger_create('bitbake-dumpsig')
def find_siginfo_task(bbhandler, pn, taskname):
""" Find the most recent signature file for the specified PN/task """