diff options
| author | Christopher Larson <chris_larson@mentor.com> | 2016-02-11 17:13:23 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-16 09:04:23 +0000 |
| commit | 4bf8b21ab838143c6e875e600da276c77bc5ea67 (patch) | |
| tree | 3132901c93207a780cea921724f532448cc3aa5d /bitbake/lib | |
| parent | 3b35de31b842d2e15a6dad8a90a1b6b7cbd3e4cc (diff) | |
| download | poky-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')
| -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=""): |
