[issue34107] root.warning('msg') output format modified by logging.warning('msg')

Michael Kearney report at bugs.python.org
Fri Jul 13 16:03:39 EDT 2018


Michael Kearney <dsmakearney at gmail.com> added the comment:

Thanks for the clarification and doc pointers. I saw "lastResort" attribute in the code 
but had not fully understood what was going on. I am not certain I really do now, but that's ok. That's why we read docs, read and write
code. Eventually it starts making sense.
It appears that there is history to contend with or complications provoked by threads. 

I had not yet read the lastResort discussion in the documentation. That's deep in the 
advanced tutorial, I was getting tripped up by simple examples that I concocted from 
very simple cases, which can be on the fringes of actual usage. I wonder why "lastResort" differs from the built-in default. 

I was playing with basicConfig because I wanted to experiment with formatting and level,
and I managed to generate messages that seemed unrelated to formating I had specified.


For now it appears that after
    import logging

I can add 
    logging.warning('')

and achieve what I want. I get the default format where I expect rather than lastResort format.

I prefer the default format that I get from the internal call to basicConfig.
I can imagine the there will be a situation where I want the even simpler
"last resort format".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34107>
_______________________________________


More information about the Python-bugs-list mailing list