Skip to content

Commit

Permalink
Update to use the new functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Dec 6, 2024
1 parent 79028bf commit 27c3606
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/randomforest/randomforest.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

/**
Expand Down
10 changes: 5 additions & 5 deletions cpp/test/sg/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,15 @@ 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);
}
};

TEST_F(LoggerTest, callback)
{
std::string testMsg;
default_logger().set_callback(exampleCallback);
default_logger().sinks().push_back(std::make_shared<callback_sink_mt>(exampleCallback));

testMsg = "This is a critical message";
CUML_LOG_CRITICAL(testMsg.c_str());
Expand All @@ -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<callback_sink_mt>(exampleCallback));
auto const testMsg = "This is a critical message";
CUML_LOG_CRITICAL(testMsg);
ASSERT_EQ(1, flushCount);
}

Expand Down

0 comments on commit 27c3606

Please sign in to comment.