From 9dd4e11e3d091bb9ef2fcec82f6fed3e7fe2b26f Mon Sep 17 00:00:00 2001 From: Jim Crist-Harif Date: Mon, 13 Jan 2025 17:12:43 -0600 Subject: [PATCH] Avoid duplicate log entries Previously the logger would have two sinks configured (the default + our custom one). This PR clears the default logger before registering our custom one. --- python/cuml/cuml/internals/logger.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/cuml/cuml/internals/logger.pyx b/python/cuml/cuml/internals/logger.pyx index 0bc09126bd..5dec86fd18 100644 --- a/python/cuml/cuml/internals/logger.pyx +++ b/python/cuml/cuml/internals/logger.pyx @@ -319,5 +319,6 @@ def flush(): IF GPUBUILD == 1: - # Set callback functions to handle redirected sys.stdout in Python + # Clear existing sinks and add a callback sink to redirect to sys.stdout + default_logger().sinks().clear() default_logger().sinks().push_back( make_shared[callback_sink_mt](_log_callback, _log_flush))