Skip to content

Commit 44f3cb1

Browse files
committed
wokring on bug
1 parent 5891390 commit 44f3cb1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dsg_lib/common_functions/logging_config.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,18 @@ def write(self, message):
227227
else:
228228
raise # Reraise if max retries exceeded
229229

230+
231+
basic_config_handlers = []
230232
if file_sink:
231233
# Create an instance of ResilientFileSink
232234
resilient_sink = ResilientFileSink(str(log_path))
233235

234236
# Configure the logger to use the ResilientFileSink
235-
logger.add(resilient_sink, format=log_format)
237+
basic_config_handlers.append(resilient_sink)
238+
239+
basic_config_handlers = []
240+
if intercept_standard_logging:
241+
basic_config_handlers.append(InterceptHandler())
242+
243+
if len(basic_config_handlers) > 0:
244+
logging.basicConfig(handlers=basic_config_handlers, level=logging_level.upper())

0 commit comments

Comments
 (0)