[issue34199] Add support for delete logger in log module.

2018-07-23 Thread Chetan kolhe


New submission from Chetan kolhe :

Hi,
Currently, there is no support for whether the logger object is present or not. 
when logging module imported in current namespace all logger object get 
imported. which uses the memory.
Add the option explicitly to delete the logger object.

e.g logging.deletLoger("name for logger object")

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 322202
nosy: chetankolhe
priority: normal
severity: normal
status: open
title: Add support for delete logger in log module.
type: enhancement
versions: Python 3.8

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



[issue34199] Add support for delete logger in log module.

2018-07-23 Thread Chetan kolhe


Chetan kolhe  added the comment:

Hi

Loggers are static objects managed by the module itself. When you create one, 
it won't be removed until you leave the shell

all logger instance is stored in this location.
"Logger.manager.loggerDict" which is the dictionary.
we can delete logger instance using that dictionary.

so why don't we give the support for deleting the logger object?

Scenario:-
I am writing the one Django project which consists produce the number of logger 
object depending on the requirement to store the log properly. Currently, I am 
using "Logger.manager.loggerDict" to delete unnecessary logger object using 
this dictionary. Currently, i have written code which deletes the parent to 
child logger object depending on their name. Storing those unrequired logger 
object in the current namespace is better to delete the logger object 
explicitly.

--

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



[issue34244] Add support of check logger

2018-07-26 Thread Chetan kolhe


New submission from Chetan kolhe :

Add support in logging library which will check whether the logger object 
already created or not .

Module:- logging

Code:-

def check_logger(self, logger_name):
"""
Description :- It will check whether the logger object is already 
present or not .
:param logger_name:

:return: True/False
"""
if Logger.manager.loggerDict.get(logger_name):
return False
else:
return True

--
components: Library (Lib)
messages: 322462
nosy: chetankolhe
priority: normal
severity: normal
status: open
title: Add support of check logger
type: enhancement
versions: Python 3.8

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