[bitbake-devel] [PATCH 1/3] bitbake: msg: Return config object
Joshua Watt
jpewhacker at gmail.com
Thu Mar 12 18:30:02 UTC 2020
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.
Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
---
bitbake/lib/bb/msg.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index c22d0d3e15..3f95e21cc1 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -270,7 +270,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.
@@ -292,6 +293,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
--
2.17.1
More information about the bitbake-devel
mailing list