airflow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allison Wang <>
Subject Re: Logging
Date Tue, 21 Nov 2017 18:05:49 GMT
Hi William,

The code is trying to use the first log handler that has name
task_log_handler to fetch the log. There can only be one log handler used
to retrieve the logs.

On Tue, Nov 21, 2017 at 8:28 AM William Pursell <> wrote:

> I will be the first to admit that I'm a little confused about logging, but
> I'm hoping someone can clarify what I think is a bug.  Or it's just my
> misunderstanding of python.  Or a misunderstanding about logging.
> I don't seem to be able to get much utility from having multiple log
> handlers.  And I'm curious about this line of code:
> It feels like the code is trying to generate multiple possible handlers and
> use the one that successfully finds the log, but the above mentioned line
> is a bit of a fake generator.  In the sense that it calls 'next' to grab
> the next value from the generator, but since the generator's scope is just
> the local function, it always just grabs the first handler.  That is, other
> than the default it might as well just be coded as a list comprehension:
> handler = [handler for handler in logger.handlers if ==
> task_log_reader][0]
> So my question is: is this attempting to use multiple log handlers to find
> the log and not doing so because  of a bug using 'next', or am I
> misunderstanding what the log reader is trying to do?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message