diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c08a314f..0a0e1f175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## neptune-client 0.13.3 + +### Fixes +- Fixed multithreading bug with StdStreamCaptureLogger ([#762](https://github.com/neptune-ai/neptune-client/pull/762)) + ## neptune-client 0.13.2 ### Fixes diff --git a/neptune/new/internal/streams/std_stream_capture_logger.py b/neptune/new/internal/streams/std_stream_capture_logger.py index c09381873..b4e664f92 100644 --- a/neptune/new/internal/streams/std_stream_capture_logger.py +++ b/neptune/new/internal/streams/std_stream_capture_logger.py @@ -28,14 +28,14 @@ def __init__(self, run: Run, attribute_name: str, stream: TextIO): self._logger = NeptuneLogger(run, attribute_name) self.stream = stream self._thread_local = threading.local() - self._thread_local.enabled = True + self.enabled = True def write(self, data: str): if not hasattr(self._thread_local, "inside_write"): self._thread_local.inside_write = False self.stream.write(data) - if self._thread_local.enabled and not self._thread_local.inside_write: + if self.enabled and not self._thread_local.inside_write: try: self._thread_local.inside_write = True self._logger.log(data) @@ -46,7 +46,7 @@ def __getattr__(self, attr): return getattr(self.stream, attr) def close(self): - self._thread_local.enabled = False + self.enabled = False class StdoutCaptureLogger(StdStreamCaptureLogger):