<div dir="ltr">Not sure if that is what you meant, but here is already "FATAL" which is indeed an alias of CRITICAL:<br><br>>>> logging.FATAL<div>50</div><div>>>> logging.fatal</div><div><function critical at 0x7f870b9edaa0></div><div class="gmail_extra"><br><div class="gmail_quote">On 28 November 2017 at 19:45, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">These look like good improvements. I think you should make an issue on <a href="http://bugs.python.org" target="_blank">bugs.python.org</a> describing your proposal and if you can submit a PR that implements it.<br></div><div class="gmail_extra"><div><div class="m_-4322016802928873475h5"><br><div class="gmail_quote">On Tue, Nov 28, 2017 at 11:25 AM, Mike Miller <span dir="ltr"><<a href="mailto:python-ideas@mgmiller.net" target="_blank">python-ideas@mgmiller.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I use the logging module extensively for even the simplest scripts, one of the reasons there's been less difficulty moving to Python 3 at work. One of the "nano features" I've often added to its config is the addition of a custom log level. Never mentioned it before because of its triviality and minor use cases, but just realized that I've been doing it five years now and happy with it, so why not?<br>
<br>
NOTE (~35)<br>
<br>
It is called the "note" level and used when one needs to express something important, yet positive, and have it be output by default. The standard levels don't support this currently, you often have to potentially scare the end user with a warning or higher to have a message emitted.<br>
<br>
Typically I use it to return important information that was asked for specifically and retrieved successfully, e.g.:<br>
<br>
log.note('Your token is: %s', token)<br>
log.note(f'⏵ {<a href="http://item.id" rel="noreferrer" target="_blank">item.id</a>} {<a href="http://item.name" rel="noreferrer" target="_blank">item.name</a>}')<br>
<br>
There are other examples. Sphinx, has the concept of note admonitions for docs in addition to warning and danger. Bootstrap has note banners for web/apps. There is something important to express or highlight, but nothing to worry about.<br>
<br>
<br>
FATAL (alias of CRITICAL)<br>
<br>
Can't find it now, but believe the docs in the past stated that CRITICAL was meant for *unrecoverable* errors. I've never had a project where I didn't shut down immediately after such an occurrence. Therefore I find "FATAL" a more accurate description of what happened. Log4j and other industry loggers use this level name as well.<br>
<br>
There is also an aesthetic reason to prefer "fatal". It is shorter and so aligns better with other level names for readability, e.g.:<br>
<br>
console_format = ' %(levelname)-7.7s %(message)s'<br>
<br>
Tried but never found a good abbreviation for critical, unfortunately. The other option is to add length to align the field. Most messages use the shorter level names (debug, info) so extra length results in wasted space that is very rarely needed.<br>
<br>
Hopefully someone else finds these useful. Neither depends on the other.<br>
<br>
-Mike<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
</blockquote></div><br><br clear="all"><br></div></div><span class="m_-4322016802928873475HOEnZb"><font color="#888888">-- <br><div class="m_-4322016802928873475m_-7802484581868902276gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
<br></blockquote></div><br></div></div>