[Python-ideas] Logging Levels

Nick Coghlan ncoghlan at gmail.com
Tue Nov 28 23:45:40 EST 2017


On 29 November 2017 at 06:46, Mike Miller <python-ideas at mgmiller.net> wrote:
> Hi, the reason I use note is that I want it to be output by default.  So it
> must be above warning, or perhaps the default level changed.

If the message to be displayed is part of the actual UX of a command
line tool, our advice is "You don't want the logging module, you want
the print() builtin":
https://docs.python.org/3/howto/logging.html#when-to-use-logging

As a relevant technical detail, it's also worth noting that the
default handler emits messages on stderr, while CLI UX messages should
generally be displayed on stdout.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list