New submission from Michael Kearney <>:

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
   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

messages: 321582
nosy: Michael Kearney
priority: normal
severity: normal
status: open
title: root.warning('msg') output format  modified by logging.warning('msg')
type: behavior
versions: Python 3.8
Added file:

Python tracker <>
Python-bugs-list mailing list

Reply via email to