diff options
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index cd53603a47..4e2f97b234 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py | |||
| @@ -104,6 +104,14 @@ logger.setLevel(logging.DEBUG - 2) | |||
| 104 | 104 | ||
| 105 | mainlogger = logging.getLogger("BitBake.Main") | 105 | mainlogger = logging.getLogger("BitBake.Main") |
| 106 | 106 | ||
| 107 | class PrefixLoggerAdapter(logging.LoggerAdapter): | ||
| 108 | def __init__(self, prefix, logger): | ||
| 109 | super().__init__(logger, {}) | ||
| 110 | self.__msg_prefix = prefix | ||
| 111 | |||
| 112 | def process(self, msg, kwargs): | ||
| 113 | return "%s%s" %(self.__msg_prefix, msg), kwargs | ||
| 114 | |||
| 107 | # This has to be imported after the setLoggerClass, as the import of bb.msg | 115 | # This has to be imported after the setLoggerClass, as the import of bb.msg |
| 108 | # can result in construction of the various loggers. | 116 | # can result in construction of the various loggers. |
| 109 | import bb.msg | 117 | import bb.msg |
