summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/__init__.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-02-11 17:13:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-16 09:04:23 +0000
commit4bf8b21ab838143c6e875e600da276c77bc5ea67 (patch)
tree3132901c93207a780cea921724f532448cc3aa5d /bitbake/lib/bb/__init__.py
parent3b35de31b842d2e15a6dad8a90a1b6b7cbd3e4cc (diff)
downloadpoky-4bf8b21ab838143c6e875e600da276c77bc5ea67.tar.gz
bitbake: Move bb.{debug,note,..} into their own logging domain
This lets us filter and use -l to show messages from that source specifically. (Bitbake rev: 7946927156dec33364418988eb921ddb273660eb) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/__init__.py')
-rw-r--r--bitbake/lib/bb/__init__.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index 5caa8ab9ad..bc6fa745ba 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -70,6 +70,8 @@ logger = logging.getLogger("BitBake")
70logger.addHandler(NullHandler()) 70logger.addHandler(NullHandler())
71logger.setLevel(logging.DEBUG - 2) 71logger.setLevel(logging.DEBUG - 2)
72 72
73mainlogger = logging.getLogger("BitBake.Main")
74
73# This has to be imported after the setLoggerClass, as the import of bb.msg 75# This has to be imported after the setLoggerClass, as the import of bb.msg
74# can result in construction of the various loggers. 76# can result in construction of the various loggers.
75import bb.msg 77import bb.msg
@@ -79,26 +81,26 @@ sys.modules['bb.fetch'] = sys.modules['bb.fetch2']
79 81
80# Messaging convenience functions 82# Messaging convenience functions
81def plain(*args): 83def plain(*args):
82 logger.plain(''.join(args)) 84 mainlogger.plain(''.join(args))
83 85
84def debug(lvl, *args): 86def debug(lvl, *args):
85 if isinstance(lvl, basestring): 87 if isinstance(lvl, basestring):
86 logger.warn("Passed invalid debug level '%s' to bb.debug", lvl) 88 mainlogger.warn("Passed invalid debug level '%s' to bb.debug", lvl)
87 args = (lvl,) + args 89 args = (lvl,) + args
88 lvl = 1 90 lvl = 1
89 logger.debug(lvl, ''.join(args)) 91 mainlogger.debug(lvl, ''.join(args))
90 92
91def note(*args): 93def note(*args):
92 logger.info(''.join(args)) 94 mainlogger.info(''.join(args))
93 95
94def warn(*args): 96def warn(*args):
95 logger.warn(''.join(args)) 97 mainlogger.warn(''.join(args))
96 98
97def error(*args, **kwargs): 99def error(*args, **kwargs):
98 logger.error(''.join(args), extra=kwargs) 100 mainlogger.error(''.join(args), extra=kwargs)
99 101
100def fatal(*args, **kwargs): 102def fatal(*args, **kwargs):
101 logger.critical(''.join(args), extra=kwargs) 103 mainlogger.critical(''.join(args), extra=kwargs)
102 raise BBHandledException() 104 raise BBHandledException()
103 105
104def deprecated(func, name=None, advice=""): 106def deprecated(func, name=None, advice=""):