A concrete instance of LogStream that utilizes Lumberjack to filter and pass messages between MPI nodes.
More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/slic/streams/LumberjackStream.hpp>
|
| LumberjackStream (std::ostream *stream, MPI_Comm comm, int ranksLimit) |
|
| LumberjackStream (std::ostream *stream, MPI_Comm comm, int ranksLimit, const std::string &format) |
|
| LumberjackStream (std::ostream *stream, axom::lumberjack::Lumberjack *lj) |
|
| LumberjackStream (std::ostream *stream, axom::lumberjack::Lumberjack *lj, const std::string &format) |
|
virtual | ~LumberjackStream () |
|
virtual void | append (message::Level msgLevel, const std::string &message, const std::string &tagName, const std::string &fileName, int line, bool filter_duplicates) |
| Appends the given message to the stream. More...
|
|
virtual void | flush () |
| Pushes all messages to the output node according to Lumberjack's Communication scheme. Then writes it to the given stream. More...
|
|
virtual void | push () |
| Pushes all messages once to their parent node according to Lumberjack's Communication scheme. More...
|
|
virtual void | write () |
| Writes the messages that are at the output node to the given stream. It does not flush any messages and not all messages are guaranteed to be at the output node. More...
|
|
void | setFormatString (const std::string &format) |
| Sets the format string. More...
|
|
|
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...
|
|
A concrete instance of LogStream that utilizes Lumberjack to filter and pass messages between MPI nodes.
◆ LumberjackStream() [1/4]
axom::slic::LumberjackStream::LumberjackStream |
( |
std::ostream * |
stream, |
|
|
MPI_Comm |
comm, |
|
|
int |
ranksLimit |
|
) |
| |
◆ LumberjackStream() [2/4]
axom::slic::LumberjackStream::LumberjackStream |
( |
std::ostream * |
stream, |
|
|
MPI_Comm |
comm, |
|
|
int |
ranksLimit, |
|
|
const std::string & |
format |
|
) |
| |
◆ LumberjackStream() [3/4]
◆ LumberjackStream() [4/4]
◆ ~LumberjackStream()
virtual axom::slic::LumberjackStream::~LumberjackStream |
( |
| ) |
|
|
virtual |
◆ append()
virtual void axom::slic::LumberjackStream::append |
( |
message::Level |
msgLevel, |
|
|
const std::string & |
message, |
|
|
const std::string & |
tagName, |
|
|
const std::string & |
fileName, |
|
|
int |
line, |
|
|
bool |
filter_duplicates |
|
) |
| |
|
virtual |
Appends the given message to the stream.
- Parameters
-
[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. |
- Note
- This method doesn't put anything to the console. Instead the messages are cached locally to each ranks and are dumped to the console in rank order when flush is called.
Implements axom::slic::LogStream.
◆ flush()
virtual void axom::slic::LumberjackStream::flush |
( |
| ) |
|
|
virtual |
Pushes all messages to the output node according to Lumberjack's Communication scheme. Then writes it to the given stream.
Reimplemented from axom::slic::LogStream.
◆ push()
virtual void axom::slic::LumberjackStream::push |
( |
| ) |
|
|
virtual |
Pushes all messages once to their parent node according to Lumberjack's Communication scheme.
- Note
- This does not guarantee all messages have reached the output node.
-
This does not write out to the given stream.
Reimplemented from axom::slic::LogStream.
◆ write()
virtual void axom::slic::LumberjackStream::write |
( |
| ) |
|
|
virtual |
Writes the messages that are at the output node to the given stream. It does not flush any messages and not all messages are guaranteed to be at the output node.
◆ setFormatString()
void axom::slic::LogStream::setFormatString |
( |
const std::string & |
format | ) |
|
|
inlineinherited |
Sets the format string.
- Parameters
-
- Note
- The following keywords in the format string are replaced:
-
<LEVEL> with the message type, e.g, ERROR, FATAL, etc.
-
<MESSAGE> with the user-supplied message
-
<TAG> user-supplied tag
-
<FILE> with the filename
-
<LINE> with the line number
-
<LINE> with the MPI rank
-
<TIMESTAMP> date/time the message is logged
An example illustrating how an application can setup the format string is shown below:
std::string format =
std::string( "***********************************\n" )+
std::string( "* <TIMESTAMP>\n\n" ) +
std::string( "* LEVEL=<LEVEL>\n" ) +
std::string( "* MESSAGE=<MESSAGE>\n" ) +
std::string( "* FILE=<FILE>\n" ) +
std::string( "* LINE=<LINE>\n" ) +
std::string( "* RANK=<RANK>\n" ) +
std::string( "***********************************\n" );
References axom::slic::LogStream::append().
◆ getFormatedMessage()
std::string axom::slic::LogStream::getFormatedMessage |
( |
const std::string & |
msgLevel, |
|
|
const std::string & |
message, |
|
|
const std::string & |
tagName, |
|
|
const std::string & |
rank, |
|
|
const std::string & |
fileName, |
|
|
int |
line |
|
) |
| |
|
protectedinherited |
Returns the formatted message as a single string.
- Parameters
-
[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. |
- Returns
- str the formatted message string.
- Postcondition
- str != "".
Referenced by axom::slic::LogStream::push().
◆ getTimeStamp()
std::string axom::slic::LogStream::getTimeStamp |
( |
| ) |
|
|
protectedinherited |
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/slic/streams/LumberjackStream.hpp