Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python logging repeated messages

# if you call addHandler() within the code of your function, it will continue to add
# duplicate handlers to the logging singleton every time the function runs. 
# so to solve this you clear the existing handler
logging.getLogger().handlers.clear()
logging.getLogger().addHandler(...)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #logging #repeated #messages
ADD COMMENT
Topic
Name
7+8 =