Skip to content

Commit

Permalink
Adding the ability to set the log threshold when the open log action …
Browse files Browse the repository at this point in the history
…is called
  • Loading branch information
emily-howell committed Jan 16, 2025
1 parent 4a12370 commit 8c6e3ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/libs/ascent/runtimes/ascent_main_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,17 @@ AscentRuntime::BuildGraph(const conduit::Node &actions)
{
// Open Ascent Logging Stream
// This starts logging
ascent::Logger::instance().set_log_threshold(ascent::Logger::LOG_DEBUG_ID);


if(action.has_path("log_threshold"))
{
ascent::Logger::instance().set_log_threshold(action["log_threshold"].as_string());
}
else
{
ascent::Logger::instance().set_log_threshold(ascent::Logger::LOG_DEBUG_ID);
}

std::string file_pattern = action.has_path("file_pattern") ?
action["file_pattern"].as_string() : "ascent_log_output.yaml";
ASCENT_LOG_OPEN(file_pattern);
Expand Down
1 change: 1 addition & 0 deletions src/tests/ascent/t_ascent_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ TEST(ascent_logging, test_logging_actions_threshold)
conduit::Node &begin_logs= actions_begin_logs.append();
begin_logs["action"] = "open_log";
begin_logs["file_pattern"] = log_file;
begin_logs["log_threshold"] = "all";
conduit::Node &set_threshold_logs_open= actions_begin_logs.append();
set_threshold_logs_open["action"] = "set_log_threshold";
set_threshold_logs_open["log_threshold"] = "error";
Expand Down

0 comments on commit 8c6e3ea

Please sign in to comment.