Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment:

> But, seems like one has no public api to reinitialize logging to a like-fresh 
> state

For the use case of testing, you could use a context manager approach as 
described here in the logging cookbook:

https://docs.python.org/3/howto/logging-cookbook.html#using-a-context-manager-for-selective-logging

The approach outlined can be built on to add more convenience according to the 
specifics of your use case.

In this way, you can restore logging to "the state in which you found it" which 
is a potentially more useful thing than just clearing out everything.

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

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to