AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Abstract base class defining the interface of all LogStreams. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.0/src/axom/slic/core/LogStream.hpp>
Public Member Functions | |
LogStream () | |
virtual | ~LogStream () |
void | setFormatString (const std::string &format) |
Sets the format string. More... | |
virtual void | append (message::Level msgLevel, const std::string &message, const std::string &tagName, const std::string &fileName, int line, bool filter_duplicates)=0 |
Appends the given message to the stream. More... | |
virtual void | flush () |
Flushes the log stream. It's a NO-OP by default. More... | |
virtual void | push () |
Pushes messages incrementally up the log stream. NO-OP by default. More... | |
Protected Member Functions | |
std::string | getFormatedMessage (const std::string &msgLevel, const std::string &message, const std::string &tagName, const std::string &rank, const std::string &fileName, int line) |
Returns the formatted message as a single string. More... | |
std::string | getTimeStamp () |
Returns a time-stamp. More... | |
Abstract base class defining the interface of all LogStreams.
Concrete instances implement the append() method accordingly, e.g., to append the message to a file, write it to stdout, etc.
axom::slic::LogStream::LogStream | ( | ) |
|
virtual |
|
inline |
Sets the format string.
format | a format string |
An example illustrating how an application can setup the format string is shown below:
References append().
|
pure virtual |
Appends the given message to the stream.
[in] | msgLevel | the level of the message. |
[in] | message | the user-supplied message. |
[in] | tagName | user-supplied tag to associate with the given message. |
[in] | fileName | the file where this message is appended |
[in] | line | the line within the file at which the message is appended. |
[in] | filter_duplicates | optional parameter that indicates whether duplicate messages resulting from running in parallel will be filtered out. |
Implemented in axom::slic::LumberjackStream, axom::slic::SynchronizedStream, and axom::slic::GenericOutputStream.
Referenced by setFormatString().
|
inlinevirtual |
Flushes the log stream. It's a NO-OP by default.
Reimplemented in axom::slic::LumberjackStream, and axom::slic::SynchronizedStream.
|
inlinevirtual |
Pushes messages incrementally up the log stream. NO-OP by default.
Reimplemented in axom::slic::LumberjackStream.
References getFormatedMessage(), and getTimeStamp().
|
protected |
Returns the formatted message as a single string.
[in] | msgLevel | the level of the given message. |
[in] | message | the user-supplied message. |
[in] | tagName | user-supplied tag, may be MSG_IGNORE_TAG |
[in] | fileName | filename where this message is logged, may be MSG_IGNORE_FILE to ignore this field. |
[in] | line | the line number within the file where the message is logged. Likewise, may be set to MSG_IGNORE_LINE to ignore this field. |
Referenced by push().
|
protected |
Returns a time-stamp.
Referenced by push().