AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Namespaces | |
detail | |
inherit | |
Classes | |
class | Logger |
A singleton class for logging error, debug and warning messages. More... | |
class | LogStream |
Abstract base class defining the interface of all LogStreams. More... | |
class | SimpleLogger |
SimpleLogger is a simple wrapper around the initialization and finalize operations of the slic::Logger class that is helpful for unit tests and simple applications in axom. More... | |
struct | debug |
class | GenericOutputStream |
Concrete instance of LogStream, which implements functionality for logging messages to a C++ ostream object, e.g., std::cout, std::cerr, a std::ofstream, std::ostringstream, etc. More... | |
class | LumberjackStream |
A concrete instance of LogStream that utilizes Lumberjack to filter and pass messages between MPI nodes. More... | |
class | SynchronizedStream |
A concrete instance of LogStream that dumps messages to a C++ std::ostream object. More... | |
Typedefs | |
using | AbortFunctionPtr = void(*)() |
Functions | |
void | initialize (bool is_root=true) |
Initializes the SLIC logging environment and allows setting which ranks write messages (root nodes). This defaults to all ranks writing unless selectively set by the user and can be set afterwards via slic::setIsRoot(). More... | |
bool | isInitialized () |
Checks if the SLIC logging environment is initialized. More... | |
bool | isRoot () |
Checks if we are on the root rank. Used for selective logging on root nodes. More... | |
void | setIsRoot (bool is_root) |
Marks this node as root and enables the selective root logging filtering used in the SLIC_*_ROOT_* macros. More... | |
void | ensureInitialized () |
Ensures the SLIC logging environment is initialized. More... | |
void | createLogger (const std::string &name, char imask=inherit::nothing) |
Creates a new logger associated with the given name. More... | |
bool | activateLogger (const std::string &name) |
Activates the logger associated with the given name. More... | |
std::string | getActiveLoggerName () |
Returns the name of the active logger. More... | |
void | setLoggingMsgLevel (message::Level level) |
Sets desired logging level. More... | |
message::Level | getLoggingMsgLevel () |
Gets the current logging level. More... | |
void | setAbortOnError (bool status) |
Toggles the abort behavior for errors on the current active logger. More... | |
void | enableAbortOnError () |
Enables aborts on error messages for the current active logger. More... | |
void | disableAbortOnError () |
Disables aborts on error messages for the current active logger. More... | |
bool | isAbortOnErrorsEnabled () |
Checks whether aborts on errors are enabled for the current logger. More... | |
void | setAbortOnWarning (bool status) |
Toggles the abort behavior for warnings on the current active logger. More... | |
void | enableAbortOnWarning () |
Enables aborts on warnings messages for the current active logger. More... | |
void | disableAbortOnWarning () |
Disables aborts on warnings messages for the current active logger. More... | |
bool | isAbortOnWarningsEnabled () |
Checks whether aborts on warnings are enabled for the current logger. More... | |
void | setAbortFunction (AbortFunctionPtr abort_func) |
Sets the function to call when program abort is requested. More... | |
void | addStreamToMsgLevel (LogStream *ls, message::Level level) |
Adds the given stream to the given level. More... | |
void | addStreamToMsgLevel (GenericOutputStream *ls, message::Level level) |
Adds the given GenericOutputStream to the given level. More... | |
void | addStreamToAllMsgLevels (LogStream *ls) |
Adds the given stream to all levels. More... | |
void | addStreamToAllMsgLevels (GenericOutputStream *ls) |
Adds the given GenericOutputStream to all levels. More... | |
void | addStreamToTag (LogStream *ls, const std::string &tag) |
Binds the given stream to the given tag. More... | |
void | addStreamToTag (GenericOutputStream *ls, const std::string &tag) |
Binds the given GenericOutputStream to the given tag. More... | |
void | addStreamToAllTags (LogStream *ls) |
Binds the given stream to all the tags. More... | |
void | addStreamToAllTags (GenericOutputStream *ls) |
Binds the given GenericOutputStream to all the tags. More... | |
int | getNumStreamsWithTag (const std::string &tag) |
Returns the number of streams for a given tag. Returns 0 if the tag does not exist. More... | |
void | logMessage (message::Level level, const std::string &message, bool filter_duplicates=false) |
Logs the given message to all registered streams. More... | |
void | logMessage (message::Level level, const std::string &message, const std::string &tag, bool filter_duplicates=false, bool tag_stream_only=false) |
Logs the given message to all registered streams. More... | |
void | logMessage (message::Level level, const std::string &message, const std::string &fileName, int line, bool filter_duplicates=false) |
Logs the given message to all registered streams. More... | |
void | logMessage (message::Level level, const std::string &message, const std::string &tag, const std::string &fileName, int line, bool filter_duplicates=false, bool tag_stream_only=false) |
Logs the given message to all registered streams. More... | |
void | logErrorMessage (const std::string &message, const std::string &fileName, int line) |
Convenience method to log an error message. More... | |
void | logWarningMessage (const std::string &message, const std::string &fileName, int line) |
Convenience method to log warning messages. More... | |
void | outputLocalMessages () |
For the current rank, outputs messages from all streams to the console. More... | |
std::string | stacktrace () |
Uses glibc's backtrace() functionality to return a stacktrace. More... | |
Collective Methods | |
| |
void | abort () |
Calls abort function. Default is abort() or MPI_Abort() in a MPI distributed environment. More... | |
void | flushStreams () |
Flushes all streams for all ranks. More... | |
void | pushStreams () |
Pushes all streams. More... | |
void | finalize () |
Finalizes the slic logging environment. More... | |
using axom::slic::AbortFunctionPtr = typedef void (*)() |
void axom::slic::initialize | ( | bool | is_root = true | ) |
Initializes the SLIC logging environment and allows setting which ranks write messages (root nodes). This defaults to all ranks writing unless selectively set by the user and can be set afterwards via slic::setIsRoot().
[in] | is_root | Enables selective logging macros based on root. |
bool axom::slic::isInitialized | ( | ) |
Checks if the SLIC logging environment is initialized.
bool axom::slic::isRoot | ( | ) |
Checks if we are on the root rank. Used for selective logging on root nodes.
void axom::slic::setIsRoot | ( | bool | is_root | ) |
Marks this node as root and enables the selective root logging filtering used in the SLIC_*_ROOT_* macros.
[in] | is_root | Enables selective logging macros based on root. |
void axom::slic::ensureInitialized | ( | ) |
Ensures the SLIC logging environment is initialized.
If SLIC is not initialized when this method is called, initialize SLIC to print all messages to std::cout and log a warning that prompts developers to properly call slic::initialize() and slic::finalize().
void axom::slic::createLogger | ( | const std::string & | name, |
char | imask = inherit::nothing |
||
) |
Creates a new logger associated with the given name.
[in] | name | the name to associate with the new logger. |
[in] | imask | inheritance mask, indicates the log level streams that |
will be inherited from the "root" logger. By default, nothing is inherited.
bool axom::slic::activateLogger | ( | const std::string & | name | ) |
Activates the logger associated with the given name.
[in] | name | the name of the logger to activate. |
std::string axom::slic::getActiveLoggerName | ( | ) |
Returns the name of the active logger.
void axom::slic::setLoggingMsgLevel | ( | message::Level | level | ) |
Sets desired logging level.
[in] | level | user-supplied level to log. |
message::Level axom::slic::getLoggingMsgLevel | ( | ) |
Gets the current logging level.
void axom::slic::setAbortOnError | ( | bool | status | ) |
Toggles the abort behavior for errors on the current active logger.
[in] | status | user-supplied flag. |
void axom::slic::enableAbortOnError | ( | ) |
Enables aborts on error messages for the current active logger.
void axom::slic::disableAbortOnError | ( | ) |
Disables aborts on error messages for the current active logger.
bool axom::slic::isAbortOnErrorsEnabled | ( | ) |
Checks whether aborts on errors are enabled for the current logger.
void axom::slic::setAbortOnWarning | ( | bool | status | ) |
Toggles the abort behavior for warnings on the current active logger.
[in] | status | user-supplied flag. |
void axom::slic::enableAbortOnWarning | ( | ) |
Enables aborts on warnings messages for the current active logger.
void axom::slic::disableAbortOnWarning | ( | ) |
Disables aborts on warnings messages for the current active logger.
bool axom::slic::isAbortOnWarningsEnabled | ( | ) |
Checks whether aborts on warnings are enabled for the current logger.
void axom::slic::setAbortFunction | ( | AbortFunctionPtr | abort_func | ) |
Sets the function to call when program abort is requested.
[in] | abort_func | The user-specified function to call |
void axom::slic::addStreamToMsgLevel | ( | LogStream * | ls, |
message::Level | level | ||
) |
Adds the given stream to the given level.
[in] | ls | pointer to the log stream. |
[in] | level | the level to log. |
void axom::slic::addStreamToMsgLevel | ( | GenericOutputStream * | ls, |
message::Level | level | ||
) |
Adds the given GenericOutputStream to the given level.
[in] | ls | pointer to the GenericOutputStream. |
[in] | level | the level to log. |
void axom::slic::addStreamToAllMsgLevels | ( | LogStream * | ls | ) |
Adds the given stream to all levels.
[in] | ls | pointer to the log stream. |
void axom::slic::addStreamToAllMsgLevels | ( | GenericOutputStream * | ls | ) |
Adds the given GenericOutputStream to all levels.
[in] | ls | pointer to the GenericOutputStream. |
void axom::slic::addStreamToTag | ( | LogStream * | ls, |
const std::string & | tag | ||
) |
Binds the given stream to the given tag.
[in] | ls | pointer to the user-supplied LogStream object. |
[in] | tag | the tag that this stream will be associated with. |
void axom::slic::addStreamToTag | ( | GenericOutputStream * | ls, |
const std::string & | tag | ||
) |
Binds the given GenericOutputStream to the given tag.
[in] | ls | pointer to the user-supplied GenericOutputStream. |
[in] | tag | the tag that this stream will be associated with. |
void axom::slic::addStreamToAllTags | ( | LogStream * | ls | ) |
Binds the given stream to all the tags.
[in] | ls | pointer to the user-supplied LogStream object. |
void axom::slic::addStreamToAllTags | ( | GenericOutputStream * | ls | ) |
Binds the given GenericOutputStream to all the tags.
[in] | ls | pointer to the user-supplied GenericOutputStream. |
int axom::slic::getNumStreamsWithTag | ( | const std::string & | tag | ) |
Returns the number of streams for a given tag. Returns 0 if the tag does not exist.
[in] | tag | the tag in query. |
void axom::slic::logMessage | ( | message::Level | level, |
const std::string & | message, | ||
bool | filter_duplicates = false |
||
) |
Logs the given message to all registered streams.
[in] | level | the level of the message being logged. |
[in] | message | user-supplied message. |
[in] | filter_duplicates | optional parameter that indicates whether duplicate messages resulting from running in parallel will be filtered out. Default is false. |
void axom::slic::logMessage | ( | message::Level | level, |
const std::string & | message, | ||
const std::string & | tag, | ||
bool | filter_duplicates = false , |
||
bool | tag_stream_only = false |
||
) |
Logs the given message to all registered streams.
[in] | level | the level of the message being logged. |
[in] | message | user-supplied message. |
[in] | tag | user-supplied associated with this message. |
[in] | filter_duplicates | optional parameter that indicates whether duplicate messages resulting from running in parallel will be filtered out. Default is false. /param [in] tag_stream_only optional parameter that indicates whether the message will go only to streams bound to tagName. Default is false. |
void axom::slic::logMessage | ( | message::Level | level, |
const std::string & | message, | ||
const std::string & | fileName, | ||
int | line, | ||
bool | filter_duplicates = false |
||
) |
Logs the given message to all registered streams.
[in] | level | the level of the message being logged. |
[in] | message | user-supplied message. |
[in] | fileName | the name of the file this message is logged from. |
[in] | line | the line number within the file this message is logged. |
[in] | filter_duplicates | optional parameter that indicates whether duplicate messages resulting from running in parallel will be filtered out. Default is false. |
void axom::slic::logMessage | ( | message::Level | level, |
const std::string & | message, | ||
const std::string & | tag, | ||
const std::string & | fileName, | ||
int | line, | ||
bool | filter_duplicates = false , |
||
bool | tag_stream_only = false |
||
) |
Logs the given message to all registered streams.
[in] | level | the level of the message being logged. |
[in] | message | user-supplied message. |
[in] | tag | user-supplied tag associated with the message. |
[in] | fileName | the name of the file this message is logged from. |
[in] | line | the line number within the file this message is logged. |
[in] | filter_duplicates | optional parameter that indicates whether duplicate messages resulting from running in parallel will be filtered out. Default is false. /param [in] tag_stream_only optional parameter that indicates whether the message will go only to streams bound to tagName. Default is false. |
void axom::slic::logErrorMessage | ( | const std::string & | message, |
const std::string & | fileName, | ||
int | line | ||
) |
Convenience method to log an error message.
[in] | message | user-supplied message. |
[in] | fileName | the name of the file this message is logged from. |
[in] | line | the line number within the file that the message is logged. |
void axom::slic::logWarningMessage | ( | const std::string & | message, |
const std::string & | fileName, | ||
int | line | ||
) |
Convenience method to log warning messages.
[in] | message | user-supplied message. |
[in] | fileName | the name of the file this message is logged from. |
[in] | line | the line number within the file that the message is logged. |
void axom::slic::outputLocalMessages | ( | ) |
For the current rank, outputs messages from all streams to the console.
void axom::slic::abort | ( | ) |
Calls abort function. Default is abort() or MPI_Abort() in a MPI distributed environment.
void axom::slic::flushStreams | ( | ) |
Flushes all streams for all ranks.
void axom::slic::pushStreams | ( | ) |
Pushes all streams.
void axom::slic::finalize | ( | ) |
Finalizes the slic logging environment.
std::string axom::slic::stacktrace | ( | ) |
Uses glibc's backtrace() functionality to return a stacktrace.