All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Watt <jpewhacker@gmail.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 1/3] bitbake: msg: Return config object
Date: Thu, 12 Mar 2020 13:30:02 -0500	[thread overview]
Message-ID: <20200312183004.8339-2-JPEWhacker@gmail.com> (raw)
In-Reply-To: <20200312183004.8339-1-JPEWhacker@gmail.com>

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(-)

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



  reply	other threads:[~2020-03-12 18:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 18:30 [PATCH 0/3] More logging improvements Joshua Watt
2020-03-12 18:30 ` Joshua Watt [this message]
2020-03-12 18:30 ` [PATCH 2/3] bitbake: knotty: Treat verbconsole as a console output Joshua Watt
2020-03-12 18:30 ` [PATCH 3/3] bitbake: Use logging.shutdown() instead of bb.msg.cleanupLogging() Joshua Watt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200312183004.8339-2-JPEWhacker@gmail.com \
    --to=jpewhacker@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.