> I've no idea what setting log.level does; I would normally use
> logging.basicConfig to set that sort of thing.
>
> logging.basicConfig(level=logging.INFO)
The log.level setting is what calling log.setLevel(...) does under the
covers. What neither apparently do is have any effect on whatever
han
On 04/19/2018 04:52 AM, Thomas Jollans wrote:
Or, more often than not, it's best to use the logging module's
configuration system that creates the right web of handlers and
formatters for you.
Wow! This is the first I've heard of logging.config (although it's easy
to find now that I know that
On Apr 19, 2018 03:03, Skip Montanaro wrote:
>
>
> I really don't like the logging module, but it looks like I'm stuck
> with it. Why aren't simple/obvious things either simple or obvious?
Agreed. One thing that, in my opinion, ought to be added to the docs is sample
code to log uncaught except
On 2018-04-19 03:00, Skip Montanaro wrote:
> This session is from Python 3.6.5 on Linux:
>
import logging
log = logging.getLogger()
log.level
> 30
logging.WARN
> 30
log.warn("Awk! Goodbye...")
> Awk! Goodbye...
log.level = logging.INFO
log.info("Awk! Goodbye...")
On 19 April 2018 at 02:00, Skip Montanaro wrote:
> I really don't like the logging module, but it looks like I'm stuck
> with it. Why aren't simple/obvious things either simple or obvious?
If you can use non-stdlib things there are alternatives. I've heard
good things about logbok (https://logboo
On Thu, Apr 19, 2018 at 11:00 AM, Skip Montanaro
wrote:
> This session is from Python 3.6.5 on Linux:
>
import logging
log = logging.getLogger()
log.level
> 30
logging.WARN
> 30
log.warn("Awk! Goodbye...")
> Awk! Goodbye...
log.level = logging.INFO
log.info("Awk!
This session is from Python 3.6.5 on Linux:
>>> import logging
>>> log = logging.getLogger()
>>> log.level
30
>>> logging.WARN
30
>>> log.warn("Awk! Goodbye...")
Awk! Goodbye...
>>> log.level = logging.INFO
>>> log.info("Awk! Goodbye...")
>>> log.level
20
>>> log.level == logging.INFO
True
>>> log