[bitbake-devel] [PATCH 1/1] lib/bb/codeparser: ensure BufferedLogger respects target filtering

Christopher Larson chris_larson at mentor.com
Tue Mar 28 16:01:31 UTC 2017


On Mon, Mar 27, 2017 at 5:51 PM, Paul Eggleton <
paul.eggleton at linux.intel.com> wrote:

> BufferedLogger was sending log records to the target logger using
> handle() - this meant that the filtering (e.g. log level set)
> on the target logger was bypassed, leading for example to debug records
> getting printed when the log level was set to logging.WARNING.
>
> Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>


The ‘filter’ method of a Logger instance doesn’t log anything, it’s a
subclass of Filterer, which just checks whether it should be logged. The
‘handle’ method of a Logger already consults self.filter(), if you check
the code:

   def handle(self, record):
          """
          Call the handlers for the specified record.

          This method is used for unpickled records received from a socket,
as
          well as those created locally. Logger-level filtering is applied.
          """
          if (not self.disabled) and self.filter(record):
              self.callHandlers(record)
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20170328/7c7ad37b/attachment-0002.html>


More information about the bitbake-devel mailing list