diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/__init__.py | 16 |
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") | |||
70 | logger.addHandler(NullHandler()) | 70 | logger.addHandler(NullHandler()) |
71 | logger.setLevel(logging.DEBUG - 2) | 71 | logger.setLevel(logging.DEBUG - 2) |
72 | 72 | ||
73 | mainlogger = 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. |
75 | import bb.msg | 77 | import bb.msg |
@@ -79,26 +81,26 @@ sys.modules['bb.fetch'] = sys.modules['bb.fetch2'] | |||
79 | 81 | ||
80 | # Messaging convenience functions | 82 | # Messaging convenience functions |
81 | def plain(*args): | 83 | def plain(*args): |
82 | logger.plain(''.join(args)) | 84 | mainlogger.plain(''.join(args)) |
83 | 85 | ||
84 | def debug(lvl, *args): | 86 | def 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 | ||
91 | def note(*args): | 93 | def note(*args): |
92 | logger.info(''.join(args)) | 94 | mainlogger.info(''.join(args)) |
93 | 95 | ||
94 | def warn(*args): | 96 | def warn(*args): |
95 | logger.warn(''.join(args)) | 97 | mainlogger.warn(''.join(args)) |
96 | 98 | ||
97 | def error(*args, **kwargs): | 99 | def error(*args, **kwargs): |
98 | logger.error(''.join(args), extra=kwargs) | 100 | mainlogger.error(''.join(args), extra=kwargs) |
99 | 101 | ||
100 | def fatal(*args, **kwargs): | 102 | def 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 | ||
104 | def deprecated(func, name=None, advice=""): | 106 | def deprecated(func, name=None, advice=""): |