Struct responsible of holding information relevant to the message (in std::string form) issued by the user.
Upon TMsg initialization, instance fetches the name of the caller COutputLogger, as well as the VerbosityLevel and the mrpt::system::TTimeStamp of the message provided. The format of the message when this is printed / or written to an external file complies is given below:
Definition at line 267 of file system/COutputLogger.h.
Public Member Functions | |
TMsg (const mrpt::system::VerbosityLevel level, const std::string &msg, const COutputLogger &logger) | |
Class constructor that passes a message in std::string form as well as a reference to the COutputLogger that provided the current message. More... | |
~TMsg () | |
Default Destructor. More... | |
std::string | getAsString () const |
Return a string representation of the underlying message. More... | |
void | getAsString (std::string *contents) const |
Fill the string with the contents of the underlying message in string representation. More... | |
void | writeToStream (std::ostream &out) const |
Write the message contents to the specified stream. More... | |
void | dumpToConsole () const |
Dump the message contents to the standard output. More... | |
void | reset () |
Reset the contents of the TMsg instance. More... | |
Public Attributes | |
mrpt::system::TTimeStamp | timestamp |
Timestamp of the message. More... | |
VerbosityLevel | level |
Verbosity level of the message. More... | |
std::string | name |
Name of the COutputLogger instance that called registered the message. More... | |
std::string | body |
Actual content of the message. More... | |
COutputLogger::TMsg::TMsg | ( | const mrpt::system::VerbosityLevel | level, |
const std::string & | msg, | ||
const COutputLogger & | logger | ||
) |
Class constructor that passes a message in std::string form as well as a reference to the COutputLogger that provided the current message.
Definition at line 211 of file COutputLogger.cpp.
References mrpt::system::getCurrentTime(), and mrpt::system::COutputLogger::getLoggerName().
COutputLogger::TMsg::~TMsg | ( | ) |
Default Destructor.
Definition at line 222 of file COutputLogger.cpp.
void COutputLogger::TMsg::dumpToConsole | ( | ) | const |
Dump the message contents to the standard output.
Definition at line 253 of file COutputLogger.cpp.
References mrpt::system::CONCOL_NORMAL, mrpt::system::COutputLogger::logging_levels_to_colors, mrpt::system::LVL_ERROR, and mrpt::system::setConsoleColor().
Referenced by mrpt::system::COutputLogger::logStr().
std::string COutputLogger::TMsg::getAsString | ( | ) | const |
Return a string representation of the underlying message.
Definition at line 231 of file COutputLogger.cpp.
References mrpt::system::COutputLogger::logging_levels_to_names, and mrpt::system::timeLocalToString().
Referenced by mrpt::system::COutputLogger::getLoggerLastMsg().
void COutputLogger::TMsg::getAsString | ( | std::string * | contents | ) | const |
Fill the string with the contents of the underlying message in string representation.
Definition at line 241 of file COutputLogger.cpp.
void COutputLogger::TMsg::reset | ( | ) |
Reset the contents of the TMsg instance.
Definition at line 223 of file COutputLogger.cpp.
References INVALID_TIMESTAMP, and mrpt::system::LVL_INFO.
void COutputLogger::TMsg::writeToStream | ( | std::ostream & | out | ) | const |
Write the message contents to the specified stream.
Definition at line 245 of file COutputLogger.cpp.
std::string mrpt::system::COutputLogger::TMsg::body |
Actual content of the message.
Definition at line 303 of file system/COutputLogger.h.
Referenced by mrpt::system::COutputLogger::logStr().
VerbosityLevel mrpt::system::COutputLogger::TMsg::level |
Verbosity level of the message.
Definition at line 300 of file system/COutputLogger.h.
Referenced by mrpt::system::COutputLogger::logStr().
std::string mrpt::system::COutputLogger::TMsg::name |
Name of the COutputLogger instance that called registered the message.
Definition at line 301 of file system/COutputLogger.h.
Referenced by mrpt::system::COutputLogger::logStr().
mrpt::system::TTimeStamp mrpt::system::COutputLogger::TMsg::timestamp |
Timestamp of the message.
Definition at line 299 of file system/COutputLogger.h.
Referenced by mrpt::system::COutputLogger::logStr().
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST |