Main MRPT website > C++ reference for MRPT 1.9.9
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::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:

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

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

References mrpt::system::getCurrentTime(), and mrpt::system::COutputLogger::getLoggerName().

◆ ~TMsg()

COutputLogger::TMsg::~TMsg ( )

Default Destructor.

Definition at line 222 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 231 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 241 of file COutputLogger.cpp.

◆ reset()

void COutputLogger::TMsg::reset ( void  )

Reset the contents of the TMsg instance.

Definition at line 223 of file COutputLogger.cpp.

References INVALID_TIMESTAMP, and mrpt::system::LVL_INFO.

◆ writeToStream()

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

Write the message contents to the specified stream.

See also
getAsString

Definition at line 245 of file COutputLogger.cpp.

Member Data Documentation

◆ body

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().

◆ level

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().

◆ name

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().

◆ timestamp

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.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019