[issue40015] logging.Logger.disabled field is redundant

2020-03-19 Thread Venkatesh-Prasad Ranganath


New submission from Venkatesh-Prasad Ranganath :

`logging.Logger.disabled` field is assigned `False` while initializing 
`logging.Logger` instance and never updated.  However, this field is also 
involved in two checks: 
https://github.com/python/cpython/blob/da1fe768e582387212201ab8737a1a5f26110664/Lib/logging/__init__.py#L1586
 and 
https://github.com/python/cpython/blob/da1fe768e582387212201ab8737a1a5f26110664/Lib/logging/__init__.py#L1681
 that are executed in the context of every logging method.  So, these checks 
are likely to contribute to unnecessary computation while logging.

Further, since the library documentation does not mention this field, the field 
is probably not part of the public API of the logging library.  So, the field 
seems to be redundant.

Given the checks on the hot paths are redundant as the field never changes 
value and fields is not part of the public API, removing it will help improve 
logging performance and simplify the code base.

--
components: Library (Lib)
messages: 364612
nosy: rvprasad
priority: normal
severity: normal
status: open
title: logging.Logger.disabled field is redundant
type: performance
versions: Python 3.8

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



[issue40015] logging.Logger.disabled field is redundant

2020-03-19 Thread Venkatesh-Prasad Ranganath


Venkatesh-Prasad Ranganath  added the comment:

`logging.Logger.disabled` field is used in logging.config module to disable 
loggers during configuration.  Since the field is not redundant, the issue is 
invalid and, hence, should be closed.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.9

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