[issue44440] logging does not work as documented (setLevel)

2021-06-29 Thread Vinay Sajip


Vinay Sajip  added the comment:

As Henk-Jaap points out, this is not a bug. You can't take a single sentence or 
even paragraph without considering the whole picture. In particular, this 
section

https://docs.python.org/3/howto/logging.html#what-happens-if-no-configuration-is-provided

explains clearly why the behaviour you noticed is as expected. Another section 
even depicts it pictorially:

https://docs.python.org/3/howto/logging.html#logging-flow

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44440] logging does not work as documented (setLevel)

2021-06-28 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Henk-Jaap Wagenaar


Henk-Jaap Wagenaar  added the comment:

The sentence within the doc should not be considered in isolation.

The "Logger" object is *not* ignoring the message (in accordance with the 
documentation and your expectation), but the "Handler" is, see 
https://docs.python.org/3.8/library/logging.html#logging.Handler.setLevel and 
here: https://docs.python.org/3/howto/logging.html: "The default level is 
WARNING, which means that only events of this level and above will be tracked, 
unless the logging package is configured to do otherwise."

Logging is quite complicated, and reading the API reference is not the best 
starting point, as is noted at the top of the page and links provided.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Alexander Dietz


Alexander Dietz  added the comment:

I was not asking for a solution or a workaround. I simply wanted to submit this 
bug in either the code or the documentation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Henk-Jaap Wagenaar


Henk-Jaap Wagenaar  added the comment:

Logging can be quite tricky. There are filters at multiple levels. In this 
case, you didn't set up the "global logging" and I am guessing, by default, it 
only shows WARNING and above. You can fix your problem by doing:

logging.basicConfig(level=logging.DEBUG)

--
nosy: +cryvate

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Alexander Dietz


New submission from Alexander Dietz :

Using python 3.8.10 and the documentation 
https://docs.python.org/3.8/library/logging.html it seems that either the 
documentation is incorrect/unclear, or that the logging module does not work as 
described. 

Reading on the Logger Object and the setLevel method I created the attached 
python code, which does not work as expected. As I set the level to "DEBUG", 
and the documentation clearly says " Logging messages which are less severe 
than level will be ignored". But having set the level to DEBUG, even the more 
"severe" info message is ignored. That is clearly contradicting the 
documentation!

--
assignee: docs@python
components: Documentation
files: problem.py
messages: 395984
nosy: alex4200, docs@python
priority: normal
severity: normal
status: open
title: logging does not work as documented (setLevel)
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50114/problem.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com