From 0dd9e5a84d83cd3b1f623cae52fea10f5eb59f9b Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Thu, 12 Mar 2020 13:30:02 -0500 Subject: bitbake: msg: Return config object Returns the configuration object from setLoggingConfig(). This object has a config dictionary that contains all of the created handlers, filters and loggers, which makes it much easier to pull out items with specific names. (Bitbake rev: 93c98a85cb10d3795b3cebc9cd97214d0f4748e5) Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- bitbake/lib/bb/msg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 582165dd08..2ba4824227 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py @@ -306,7 +306,8 @@ def setLoggingConfig(defaultconfig, userconfigfile=None): if "level" in l: l["level"] = bb.msg.stringToLevel(l["level"]) - logging.config.dictConfig(logconfig) + conf = logging.config.dictConfigClass(logconfig) + conf.configure() # The user may have specified logging domains they want at a higher debug # level than the standard. @@ -328,6 +329,8 @@ def setLoggingConfig(defaultconfig, userconfigfile=None): #if newlevel < bb.msg.loggerDefaultLogLevel: # bb.msg.loggerDefaultLogLevel = newlevel + return conf + def cleanupLogging(): # Iterate through all the handlers and close them if possible. Fixes # 'Unclosed resource' warnings when bitbake exits, see -- cgit v1.2.3-54-g00ecf