summaryrefslogtreecommitdiffstats
path: root/bin/bitbake-diffsigs
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-diffsigs
parentff1ccd1db5d70b3fc9ad0d3e8f3d7b804c22bf36 (diff)
downloadbitbake-contrib-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-diffsigs')
-rwxr-xr-xbin/bitbake-diffsigs14
1 files changed, 2 insertions, 12 deletions
diff --git a/bin/bitbake-diffsigs b/bin/bitbake-diffsigs
index c087f99bc..1e3de092a 100755
--- a/bin/bitbake-diffsigs
+++ b/bin/bitbake-diffsigs
@@ -30,19 +30,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-diffsigs')
+logger = bb.msg.logger_create('bitbake-diffsigs')
def find_compare_task(bbhandler, pn, taskname):
""" Find the most recent signature files for the specified PN/task and compare them """