Message 321582 - Python tracker

Message321582

Author Michael Kearney
Recipients Michael Kearney
Date 2018-07-13.00:25:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531441505.36.0.56676864532.issue34107@psf.upfronthosting.co.za>
In-reply-to
Content
0 >>> import logging
1 >>> root=logging.getLogger(name='root')
2 >>> root.warning('msg')
3 msg                                   <----- Compare this line
4 >>> logging.warning('msg')
5 WARNING:root:msg
6 >>> root.warning('msg')
7 WARNING:root:msg                      <------ with this line

Specifically, I was surprised to see
   line 7 response to line 6
given
   line 3 response to line 2

logger methods log(),critical(),error(),info() act the same way.

A workaround from issue 33897 fixes things
   logging.basicConfig(level=logging.DEBUG, force=True)

I discovered this when exploring "logging" module defaults, It is the sort of thing someone new to the module might encounter. I did.

Slightly more comprehensive unittest example attached.

This may be my first real submission. Feedback appreciated
History
Date User Action Args
2018-07-13 00:25:06Michael Kearneysetrecipients: + Michael Kearney
2018-07-13 00:25:05Michael Kearneysetmessageid: <1531441505.36.0.56676864532.issue34107@psf.upfronthosting.co.za>
2018-07-13 00:25:05Michael Kearneylinkissue34107 messages
2018-07-13 00:25:02Michael Kearneycreate