[bitbake-devel,1/3] bitbake: msg: Return config object

Submitted by Joshua Watt on March 12, 2020, 6:30 p.m. | Patch ID: 170993

Details

Message ID 20200312183004.8339-2-JPEWhacker@gmail.com
State New
Headers show

Commit Message

Joshua Watt March 12, 2020, 6:30 p.m.
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@gmail.com>
---
 bitbake/lib/bb/msg.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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