RobWorkProject
Public Types | Public Member Functions | Protected Member Functions | List of all members
LogWriter Class Referenceabstract

Write interface for Logs. More...

#include <LogWriter.hpp>

Inherited by LogBufferedChar, LogBufferedMsg, LogFileWriter, LogMultiWriter, and LogStreamWriter.

Public Types

typedef rw::common::Ptr< LogWriterPtr
 smart pointer type to this class
 

Public Member Functions

virtual ~LogWriter ()
 Descructor.
 
void flush ()
 Flush method.
 
void setTabLevel (int tabLevel)
 Set the tab level.
 
void write (const std::string &str)
 Writes str to the log. More...
 
void write (const Message &msg)
 Writes msg to the log. More...
 
void writeln (const std::string &str)
 Writes str as a line. More...
 
template<class T >
LogWriteroperator<< (T t)
 general stream operator
 
LogWriteroperator<< (const std::string &str)
 specialized stream operator 2
 
LogWriteroperator<< (const Message &msg)
 Write Message to log. More...
 
LogWriteroperator<< (const char *str)
 specialized stream operator
 
LogWriteroperator<< (std::ostream &(*pf)(std::ostream &))
 Handle the std::endl and other stream functions.
 

Protected Member Functions

virtual void doWrite (const std::string &message)=0
 
virtual void doSetTabLevel (int tabLevel)=0
 
virtual void doFlush ()=0
 

Detailed Description

Write interface for Logs.

LogWriter provides an output strategy for a log.

Member Function Documentation

◆ operator<<()

LogWriter& operator<< ( const Message msg)
inline

Write Message to log.

Parameters
msg[in] the message.
Returns
a reference to this LogWriter for chaining of stream operators.

◆ write() [1/2]

void write ( const std::string &  str)

Writes str to the log.

Parameters
str[in] message to write

◆ write() [2/2]

void write ( const Message msg)

Writes msg to the log.

Default behavior is to use write(const std::string&) for the standard streaming representation of msg.

Parameters
msg[in] message to write

◆ writeln()

void writeln ( const std::string &  str)

Writes str as a line.

By default writeln writes str followed by a '\n'. However, logs are free to implement a line change differently.


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