From 47cb4d2fee146698236bd9c949a4f3f2381d164d Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 6 Dec 2024 01:23:24 +0000 Subject: [PATCH] Update to use the new functionality --- cpp/CMakeLists.txt | 2 +- cpp/src/randomforest/randomforest.cu | 2 +- cpp/test/sg/logger.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index aeb49cfcc9..8d51ad91ce 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -222,7 +222,7 @@ rapids_cmake_install_lib_dir(lib_dir) # Not using rapids-cmake since we never want to find, always download. CPMAddPackage( - NAME rapids_logger GITHUB_REPOSITORY rapidsai/rapids-logger GIT_SHALLOW TRUE GIT_TAG 14bb233d2420f7187a690f0bb528ec0420c70d48 + NAME rapids_logger GITHUB_REPOSITORY vyasr/rapids-logger GIT_SHALLOW TRUE GIT_TAG feat/cuml ) rapids_make_logger( ML EXPORT_SET cuml-exports LOGGER_HEADER_DIR include/cuml/common/ LOGGER_MACRO_PREFIX CUML LOGGER_TARGET cuml_logger diff --git a/cpp/src/randomforest/randomforest.cu b/cpp/src/randomforest/randomforest.cu index dd13465bb9..4d70f3ea27 100644 --- a/cpp/src/randomforest/randomforest.cu +++ b/cpp/src/randomforest/randomforest.cu @@ -166,7 +166,7 @@ void postprocess_labels(int n_rows, labels[i] = reverse_map[prev]; CUML_LOG_DEBUG("Mapping %d back to %d", prev, labels[i]); } - CUML_LOG_DEBUG("Finished postrocessing labels"); + CUML_LOG_DEBUG("Finished postprocessing labels"); } /** diff --git a/cpp/test/sg/logger.cpp b/cpp/test/sg/logger.cpp index d57838fa1e..929f023e0e 100644 --- a/cpp/test/sg/logger.cpp +++ b/cpp/test/sg/logger.cpp @@ -57,8 +57,7 @@ class LoggerTest : public ::testing::Test { void TearDown() override { - default_logger().remove_callback(); - // default_logger().setFlush(nullptr); + default_logger().sinks().pop_back(); default_logger().set_level(ML::level_enum::info); } }; @@ -66,7 +65,7 @@ class LoggerTest : public ::testing::Test { TEST_F(LoggerTest, callback) { std::string testMsg; - default_logger().set_callback(exampleCallback); + default_logger().sinks().push_back(std::make_shared(exampleCallback)); testMsg = "This is a critical message"; CUML_LOG_CRITICAL(testMsg.c_str()); @@ -91,8 +90,9 @@ TEST_F(LoggerTest, callback) TEST_F(LoggerTest, flush) { - // default_logger().setFlush(exampleFlush); - default_logger().flush(); + default_logger().sinks().push_back(std::make_shared(exampleCallback)); + auto const testMsg = "This is a critical message"; + CUML_LOG_CRITICAL(testMsg); ASSERT_EQ(1, flushCount); }