What should go to stdout/stderr and why Python logging write everything to stderr?

Chris Angelico rosuav at gmail.com
Tue Jan 3 16:59:42 EST 2023


On Wed, 4 Jan 2023 at 08:25, <c.buhtz at posteo.jp> wrote:
>
> Am 03.01.2023 17:51 schrieb ram at zedat.fu-berlin.de:
> > logging.getLogger().addHandler( logging.StreamHandler( sys.stdout ))
>
> But I don't want to make all log levels go to stdout. Just DEBUG and
> INFO. But this would be a workaround.

But why are DEBUG logs part of stdout? That doesn't make any sense.

> The main question here is why does Python deciecded to make all logs go
> to stderr?
> Maybe I totally misunderstood the intention of logging.info()?! Isn't
> this the "usual applicaton output"?
>
> If not, what messages should go into logging.info()? Can you name me
> some examples?

Reports of what the program is doing.

ChrisA


More information about the Python-list mailing list