Celeritas
0.5.0-56+6b053cd
|
#include <string>
#include <utility>
#include "corecel/Config.hh"
#include "LoggerTypes.hh"
#include "detail/LoggerMessage.hh"
Classes | |
class | celeritas::Logger |
Create a log message to be printed based on output/verbosity sttings. More... | |
Macros | |
#define | CELER_CODE_PROVENANCE |
Inject the source code provenance (current file and line) More... | |
#define | CELER_LOG(LEVEL) |
Return a LogMessage object for streaming into at the given level. More... | |
#define | CELER_LOG_LOCAL(LEVEL) |
Like CELER_LOG but for code paths that may only happen on a single process or thread. More... | |
Functions | |
LogLevel | celeritas::log_level_from_env (std::string const &level_env, LogLevel default_lev) |
Get the log level from an environment variable. | |
LogLevel | celeritas::log_level_from_env (std::string const &level_env) |
Get the log level from an environment variable. More... | |
Logger | celeritas::make_default_world_logger () |
Create a default logger using the world communicator. More... | |
Logger | celeritas::make_default_self_logger () |
Create a default logger using the local communicator. More... | |
Logger & | celeritas::world_logger () |
Parallel-enabled logger: print only on "main" process. More... | |
Logger & | celeritas::self_logger () |
Serial logger: print on every process that calls it. More... | |
#define CELER_CODE_PROVENANCE |
Inject the source code provenance (current file and line)
#define CELER_LOG | ( | LEVEL | ) |
Return a LogMessage object for streaming into at the given level.
The regular CELER_LOG
call is for code paths that happen uniformly in parallel.
The logger will only format and print messages. It is not responsible for cleaning up the state or exiting an app.
#define CELER_LOG_LOCAL | ( | LEVEL | ) |
Like CELER_LOG
but for code paths that may only happen on a single process or thread.
Use sparingly.
LogLevel celeritas::log_level_from_env | ( | std::string const & | level_env | ) |
Get the log level from an environment variable.
Default to Logger::default_level
, which is 'info'.
Logger celeritas::make_default_self_logger | ( | ) |
Create a default logger using the local communicator.
If MPI is enabled, this will prepend the local process index to the message.
Logger celeritas::make_default_world_logger | ( | ) |
Create a default logger using the world communicator.
The result prints only on one processor in the world communicator group. This function can be useful when resetting a test harness.
Logger & celeritas::self_logger | ( | ) |
Serial logger: print on every process that calls it.
Setting the "CELER_LOG_LOCAL" environment variable to "debug", "info", "error", etc. will change the default log level.
Logger & celeritas::world_logger | ( | ) |
Parallel-enabled logger: print only on "main" process.
Setting the "CELER_LOG" environment variable to "debug", "info", "error", etc. will change the default log level.