summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-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=""):