]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
Move bb.{debug,note,..} into their own logging domain
authorChristopher Larson <chris_larson@mentor.com>
Fri, 12 Feb 2016 00:13:23 +0000 (17:13 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 16 Feb 2016 09:04:06 +0000 (09:04 +0000)
This lets us filter and use -l to show messages from that source specifically.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/__init__.py

index 5caa8ab9ada96f3fe94a94261ccbd964c0a7e8f6..bc6fa745baa0e07d8e94c13fdbf5b583a22098ed 100644 (file)
@@ -70,6 +70,8 @@ logger = logging.getLogger("BitBake")
 logger.addHandler(NullHandler())
 logger.setLevel(logging.DEBUG - 2)
 
+mainlogger = logging.getLogger("BitBake.Main")
+
 # This has to be imported after the setLoggerClass, as the import of bb.msg
 # can result in construction of the various loggers.
 import bb.msg
@@ -79,26 +81,26 @@ sys.modules['bb.fetch'] = sys.modules['bb.fetch2']
 
 # Messaging convenience functions
 def plain(*args):
-    logger.plain(''.join(args))
+    mainlogger.plain(''.join(args))
 
 def debug(lvl, *args):
     if isinstance(lvl, basestring):
-        logger.warn("Passed invalid debug level '%s' to bb.debug", lvl)
+        mainlogger.warn("Passed invalid debug level '%s' to bb.debug", lvl)
         args = (lvl,) + args
         lvl = 1
-    logger.debug(lvl, ''.join(args))
+    mainlogger.debug(lvl, ''.join(args))
 
 def note(*args):
-    logger.info(''.join(args))
+    mainlogger.info(''.join(args))
 
 def warn(*args):
-    logger.warn(''.join(args))
+    mainlogger.warn(''.join(args))
 
 def error(*args, **kwargs):
-    logger.error(''.join(args), extra=kwargs)
+    mainlogger.error(''.join(args), extra=kwargs)
 
 def fatal(*args, **kwargs):
-    logger.critical(''.join(args), extra=kwargs)
+    mainlogger.critical(''.join(args), extra=kwargs)
     raise BBHandledException()
 
 def deprecated(func, name=None, advice=""):