superbenchmark icon indicating copy to clipboard operation
superbenchmark copied to clipboard

Bug Fix - Set self.logger_stream to None in StdLogger.stop() (#708)

Open Tiger1218 opened this issue 8 months ago • 0 comments

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 avatar May 13 '25 09:05 Tiger1218