-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow replacing a logging.StreamHandler's stream #74707
Comments
Right now it is probably possible using something like: handler.acquire()
try:
handler.flush()
handler.stream = new_stream
finally:
handler.release() but it would be nice to have an officially-supported method to do that. Context: if I reconfigure sys.stderr, I'd like to update all handlers that have a reference to the old sys.stderr. |
Which StreamHandler class? Is this issue related to logging? If yes, please mention it in the title ;-) |
Oh, yes, sorry. This is about logging. |
How about this as an API? def setStream(self, stream):
"""
Sets the StreamHandler's stream to the specified value,
if it is different.
|
Vinay, yes, that sounds fine to me. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: