MRPT  2.0.4
List of all members | Public Member Functions | Public Attributes
mrpt::system::COutputLogger::TMsg Struct Reference

Detailed Description

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::Clock::time_point of the message provided. The format of the message when this is printed / or written to an external file complies is given below:

[name | level | timestamp:] body

Definition at line 268 of file system/COutputLogger.h.

Public Member Functions

 TMsg (const mrpt::system::VerbosityLevel level, std::string_view 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...
 

Public Attributes

mrpt::Clock::time_point 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...
 

Constructor & Destructor Documentation

◆ TMsg()

COutputLogger::TMsg::TMsg ( const mrpt::system::VerbosityLevel  level,
std::string_view  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 222 of file COutputLogger.cpp.

◆ ~TMsg()

COutputLogger::TMsg::~TMsg ( )
default

Default Destructor.

Member Function Documentation

◆ dumpToConsole()

void COutputLogger::TMsg::dumpToConsole ( ) const

Dump the message contents to the standard output.

See also
writeToStream

Definition at line 256 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAsString() [1/2]

std::string COutputLogger::TMsg::getAsString ( ) const

Return a string representation of the underlying message.

Definition at line 234 of file COutputLogger.cpp.

References mrpt::system::COutputLogger::logging_levels_to_names(), out, and mrpt::system::timeLocalToString().

Referenced by mrpt::system::COutputLogger::getLoggerLastMsg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAsString() [2/2]

void COutputLogger::TMsg::getAsString ( std::string *  contents) const

Fill the string with the contents of the underlying message in string representation.

Definition at line 244 of file COutputLogger.cpp.

◆ writeToStream()

void COutputLogger::TMsg::writeToStream ( std::ostream &  out) const

Write the message contents to the specified stream.

See also
getAsString

Definition at line 248 of file COutputLogger.cpp.

References out.

Member Data Documentation

◆ body

std::string mrpt::system::COutputLogger::TMsg::body

Actual content of the message.

Definition at line 302 of file system/COutputLogger.h.

Referenced by mrpt::system::COutputLogger::logStr().

◆ level

VerbosityLevel mrpt::system::COutputLogger::TMsg::level

Verbosity level of the message.

Definition at line 299 of file system/COutputLogger.h.

Referenced by mrpt::system::COutputLogger::logStr().

◆ name

std::string mrpt::system::COutputLogger::TMsg::name

Name of the COutputLogger instance that called registered the message.

Definition at line 300 of file system/COutputLogger.h.

Referenced by mrpt::system::COutputLogger::logStr().

◆ timestamp

mrpt::Clock::time_point mrpt::system::COutputLogger::TMsg::timestamp

Timestamp of the message.

Definition at line 298 of file system/COutputLogger.h.

Referenced by mrpt::system::COutputLogger::logStr().




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020