Skip to content

Commit

Permalink
add test for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Dec 9, 2024
1 parent 37b805f commit 4b320c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/libs/ascent/ascent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ Ascent::open(const conduit::Node &options)
Node logging_opts;
logging_opts["enabled"] = 0;
#if defined(ASCENT_MPI_ENABLED)
logging_opts["file_pattern"] = "ascent_log_output.yaml";
logging_opts["file_pattern"] = "ascent_log_output_rank_{rank:05d}.yaml";
#else
logging_opts["file_pattern"] = "ascent_log_output_rank{rank:05d}.yaml";
logging_opts["file_pattern"] = "ascent_log_output.yaml";
#endif
logging_opts["log_threshold"] = "info";
logging_opts["log_threshold"] = "debug";

if(m_options.has_path("logging"))
{
Expand All @@ -345,7 +345,8 @@ Ascent::open(const conduit::Node &options)
ASCENT_LOG_OPEN( file_pattern ) // serial
#else
ASCENT_LOG_OPEN_RANK( file_pattern, par_rank ) // mpi par
#endif
#endif
logger.set_log_threshold(logging_opts["log_threshold"].as_string());
}


Expand Down Expand Up @@ -684,6 +685,7 @@ Ascent::close()
}

set_status("Ascent::close completed");
ASCENT_LOG_CLOSE();
}
catch(conduit::Error &e)
{
Expand All @@ -709,6 +711,7 @@ Ascent::close()
<< e.message() << std::endl;
}
}
ASCENT_LOG_CLOSE();
}
}

Expand All @@ -720,6 +723,7 @@ Ascent::set_status(const std::string &msg)
std::ostringstream oss;
oss << msg << " at " << timestamp();
m_status["message"] = oss.str();
ASCENT_LOG_DEBUG(msg);
}

//---------------------------------------------------------------------------//
Expand All @@ -732,6 +736,7 @@ Ascent::set_status(const std::string &msg,
oss << msg << " at " << timestamp();
m_status["message"] = oss.str();
m_status["details"] = details;
ASCENT_LOG_DEBUG(msg + " " + details);
}

//---------------------------------------------------------------------------//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ parse_color_table(const conduit::Node &color_table_node)
const Node &peg = itr.next();
if(!peg.has_child("position"))
{
// FIXME: This should be an error
ASCENT_WARN("Color map control point must have a position");
}

Expand Down
1 change: 1 addition & 0 deletions src/tests/ascent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(BASIC_TESTS t_ascent_smoke
t_ascent_runtime_options
t_ascent_data_binning
t_ascent_utils
t_ascent_logging
t_ascent_annotations
t_ascent_derived
t_ascent_empty_runtime
Expand Down

0 comments on commit 4b320c6

Please sign in to comment.