[elbe-devel] [PATCH 00/12] obey logging error

Olivier Dion dion at linutronix.de
Sat Sep 28 04:02:15 CEST 2019


On 2019-09-27T08:36:01-0400, Torben Hohn <torben.hohn at linutronix.de> wrote:

> On Thu, Sep 26, 2019 at 03:39:00PM -0400, Olivier Dion wrote:
> >
> > On 2019-09-26T09:33:20-0400, Torben Hohn <torben.hohn at linutronix.de> wrote:
> >
> > > 1. make the log remeber that an error has been logged.
> >
> > Note that this won't apply to the 'log' logger, since both 'echo' and
> > 'soap' will ignore message comming from 'log'.
> >
> > As for now, only `do` and `get_rpcaptcache` use the 'log' logger with
> > `async_logging`.  And `async_logging` log everything at INFO level.

> hmm... the word log is probably misleading there.

`log` is
----------------------------------------------------------------------
log = logging.getLogger("log")
----------------------------------------------------------------------

> i meant the logging machinery here. because the actual
> checking is done inside the QHandler.queues

>From what I've seen in the diff, you changed the collection.deque from
the QHandler to a LoggingQueue which do some internal work related to
error.  Thus, only messages accepted by both the `soap` and `echo`
loggers are going to be accepted.  Since the `logging.getLogger("log")`
is a logger reserved exclusively for the log.txt, it will never reach
the QHandler, this is its only point of existence.  Also, `echo` is used
in async_logging two times.  Both of these times, it will not log error
but only info, where you might want to actually check for error.

So, you might want to either A), check for these corner cases and be
careful when using `loging.getLogger("log")`, or B) add a filter, like
ThreadFilter, that will always return True for _all_ loggers and do the
internal work from there.

--
Olivier Dion
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen



More information about the elbe-devel mailing list