MRPT  1.9.9
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 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...
 

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,
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 222 of file COutputLogger.cpp.

◆ ~TMsg()

COutputLogger::TMsg::~TMsg ( )

Default Destructor.

Definition at line 232 of file COutputLogger.cpp.

Member Function Documentation

◆ dumpToConsole()

void COutputLogger::TMsg::dumpToConsole ( ) const

◆ 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(), and mrpt::system::timeLocalToString().

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

◆ 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.

Member Data Documentation

◆ body

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

Actual content of the message.

Definition at line 301 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 298 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 299 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 297 of file system/COutputLogger.h.

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




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020