Skip to content

Conversation

@Tiger1218
Copy link

Description

This PR addresses a bug in the StdLogger module where calling stop() multiple times or calling log() after the logger has been stopped would result in ValueError exceptions.

The issue arises because the internal self.logger_stream reference was not cleared (set to None) after the restore() method was called in stop(). This led to subsequent attempts to use the old, inactive stream object, which had a closed file handle.

This change adds the necessary step to set self.logger_stream = None in the stop() method after the stream is restored, ensuring the logger's state is correctly reset.

Fixes #708 .

@Tiger1218 Tiger1218 requested a review from a team as a code owner May 13, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calling stop() multiple times or log() after stop() can cause errors in StdLogger

1 participant