bitbake: Ensure manually created loggers have the once filter
PATCH 1/1 bitbake: Ensure manually created loggers have the once filter
Loggers created with a logging configuration file automatically get the once filter applied to ensure that warnonce()/erroronce() only appear a single time. The same filter needs to also be added to bb.msg.logger_create() to ensure that manually created loggers have the same behavior
Signed-off-by Joshua Watt <[email protected]>
--- bitbake/lib/bb/msg.py | 1 + 1 file changed, 1 insertion(+)
bitbake/lib/bb/msg.py +1 -0
@@ -229,6 +229,7 @@ def logger_create(name, output=sys.stderr, level=logging.INFO, preserve_handlers """Standalone logger creation function""" logger = logging.getLogger(name) console = logging.StreamHandler(output) + console.addFilter(bb.msg.LogFilterShowOnce()) format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s") if color == 'always' or (color == 'auto' and output.isatty()): format.enable_color()
Signature · 1 line
2.33.0