AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::lumberjack::Message Class Reference

Holds information about messages and where they came from. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/lumberjack/Message.hpp>

Public Member Functions

 Message ()
 Basic constructor where everything defaults to nothing. More...
 
 Message (const std::string &text, int rank, const std::string &fileName, int lineNumber, int level, const std::string &tag)
 Constructor where you can specify all values for a Message that originated from a specific rank. More...
 
 Message (const std::string &text, const std::vector< int > &ranks, int count, int ranksLimit, const std::string &fileName, int lineNumber, int level, const std::string &tag)
 Constructor where you can specify all values for a Message that originated from a multiple ranks. More...
 
std::string text () const
 Returns the text of the Message. More...
 
std::vector< int > ranks () const
 Returns the vector of the ranks where this Message originated. More...
 
int count () const
 Returns the total count of this Message. More...
 
std::string stringOfRanks (std::string delimiter=",") const
 Returns a string of ranks delimited by ',' unless otherwise specified. More...
 
std::string fileName () const
 Returns the file name of where this Message originated. More...
 
int lineNumber () const
 Returns the line number of where this Message originated. More...
 
int level () const
 Returns the level of the severity of the Message. More...
 
std::string tag () const
 Returns the tag of where the Message originated. More...
 
void text (const std::string &newText)
 Sets a new text for this Message. More...
 
void fileName (const std::string &newFileName)
 Sets a new file name for this Message. More...
 
void lineNumber (int newLineNumber)
 Sets a new line number for this Message. More...
 
void level (int newLevel)
 Sets a new severity level for this Message. More...
 
void tag (const std::string &newTag)
 Sets a new tag of where the Message originated. More...
 
void addRank (int newRank, int ranksLimit)
 Adds a rank to this Message. More...
 
void addRanks (const std::vector< int > &newRanks, int count, int ranksLimit)
 Adds multiple ranks to this Message. count tracks how many times this message has occurred since duplicates are being filtered. More...
 
std::string pack ()
 Returns a string of all information about this Message packed into a string. More...
 
void unpack (const std::string &packedMessage, int ranksLimit)
 Overrides the information in this Message with the given packed string. More...
 

Detailed Description

Holds information about messages and where they came from.

This class holds all the information about an individual message and where it came from, such as rank, file name, and line number.

See also
Combiner Lumberjack

Constructor & Destructor Documentation

◆ Message() [1/3]

axom::lumberjack::Message::Message ( )
inline

Basic constructor where everything defaults to nothing.

◆ Message() [2/3]

axom::lumberjack::Message::Message ( const std::string &  text,
int  rank,
const std::string &  fileName,
int  lineNumber,
int  level,
const std::string &  tag 
)
inline

Constructor where you can specify all values for a Message that originated from a specific rank.

Parameters
[in]textActual text of the Message.
[in]rankThe rank where the Message originated.
[in]fileNameThe file name where the Message originated.
[in]lineNumberThe line number where the Message originated.
[in]levelThe level of the severity of the Message.
[in]tagThe tag of where the Message originated.

◆ Message() [3/3]

axom::lumberjack::Message::Message ( const std::string &  text,
const std::vector< int > &  ranks,
int  count,
int  ranksLimit,
const std::string &  fileName,
int  lineNumber,
int  level,
const std::string &  tag 
)
inline

Constructor where you can specify all values for a Message that originated from a multiple ranks.

Parameters
[in]textActual text of the Message.
[in]ranksThe rank where the Message originated.
[in]countTotal number of instances of this Message.
[in]ranksLimitLimit on how many ranks are individually tracked per Message.
[in]fileNameThe file name where the Message originated.
[in]lineNumberThe line number where the Message originated.
[in]levelThe level of the severity of the Message.
[in]tagThe tag of where the Message originated.

References addRanks(), count(), and ranks().

Member Function Documentation

◆ text() [1/2]

std::string axom::lumberjack::Message::text ( ) const

Returns the text of the Message.

◆ ranks()

std::vector<int> axom::lumberjack::Message::ranks ( ) const

Returns the vector of the ranks where this Message originated.

◆ count()

int axom::lumberjack::Message::count ( ) const

Returns the total count of this Message.

◆ stringOfRanks()

std::string axom::lumberjack::Message::stringOfRanks ( std::string  delimiter = ",") const

Returns a string of ranks delimited by ',' unless otherwise specified.

Parameters
[in]delimiterThe delimiter used to separate the ranks in returned string.

◆ fileName() [1/2]

std::string axom::lumberjack::Message::fileName ( ) const

Returns the file name of where this Message originated.

◆ lineNumber() [1/2]

int axom::lumberjack::Message::lineNumber ( ) const

Returns the line number of where this Message originated.

◆ level() [1/2]

int axom::lumberjack::Message::level ( ) const

Returns the level of the severity of the Message.

◆ tag() [1/2]

std::string axom::lumberjack::Message::tag ( ) const

Returns the tag of where the Message originated.

◆ text() [2/2]

void axom::lumberjack::Message::text ( const std::string &  newText)

Sets a new text for this Message.

Parameters
[in]newTextThe new text to be set for this Message.

◆ fileName() [2/2]

void axom::lumberjack::Message::fileName ( const std::string &  newFileName)

Sets a new file name for this Message.

Parameters
[in]newFileNameThe new file name to be set for this Message.

◆ lineNumber() [2/2]

void axom::lumberjack::Message::lineNumber ( int  newLineNumber)

Sets a new line number for this Message.

Parameters
[in]newLineNumberThe new line number to be set for this message.

◆ level() [2/2]

void axom::lumberjack::Message::level ( int  newLevel)

Sets a new severity level for this Message.

Parameters
[in]newLevelThe new severity level for this Message.

◆ tag() [2/2]

void axom::lumberjack::Message::tag ( const std::string &  newTag)

Sets a new tag of where the Message originated.

Parameters
[in]newTagThe new tag of where the Message originated.

◆ addRank()

void axom::lumberjack::Message::addRank ( int  newRank,
int  ranksLimit 
)

Adds a rank to this Message.

Parameters
[in]newRankThe new rank to be added.
[in]ranksLimitLimits how many ranks are tracked per Message.

◆ addRanks()

void axom::lumberjack::Message::addRanks ( const std::vector< int > &  newRanks,
int  count,
int  ranksLimit 
)

Adds multiple ranks to this Message. count tracks how many times this message has occurred since duplicates are being filtered.

Parameters
[in]newRanksThe new ranks to be added.
[in]countCount to add to Message::count
[in]ranksLimitLimits how many ranks are tracked per Message.

◆ pack()

std::string axom::lumberjack::Message::pack ( )

Returns a string of all information about this Message packed into a string.

The Message is packed into a string utilizing the following format: <ranks delimited by ,>*<rank count>*<file name>*<line number> *<message level>*<tag>*<text>

◆ unpack()

void axom::lumberjack::Message::unpack ( const std::string &  packedMessage,
int  ranksLimit 
)

Overrides the information in this Message with the given packed string.

Parameters
[in]packedMessagePacked Message containing the new information.
[in]ranksLimitLimits how many ranks are tracked per Message.

The Message is unpacked from a string utilizing the format defined by pack()


The documentation for this class was generated from the following file: