RobWorkProject  24.5.15-
Public Member Functions | Protected Member Functions | List of all members
LogFileWriter Class Reference

Writes log output to a file. More...

#include <LogFileWriter.hpp>

Inherits LogWriter.

Public Member Functions

 LogFileWriter (const std::string &filename)
 Constructs LogFileWriter writing to a file named filename. More...
 
 ~LogFileWriter ()
 Destructor.
 
- Public Member Functions inherited from LogWriter
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

void doWrite (const std::string &str)
 Writes str to the log. More...
 
void doFlush ()
 Calls flush on the ostream.
 
void doSetTabLevel (int tabLevel)
 Set the tab level. More...
 

Additional Inherited Members

- Public Types inherited from LogWriter
typedef rw::core::Ptr< LogWriterPtr
 smart pointer type to this class
 

Detailed Description

Writes log output to a file.

Constructor & Destructor Documentation

◆ LogFileWriter()

LogFileWriter ( const std::string &  filename)

Constructs LogFileWriter writing to a file named filename.

Throws exception if failing to open file

Parameters
filename[in] Name of file

Member Function Documentation

◆ doSetTabLevel()

void doSetTabLevel ( int  tabLevel)
protectedvirtual

Set the tab level.

Implements LogWriter.

◆ doWrite()

void doWrite ( const std::string &  str)
protectedvirtual

Writes str to the log.

Parameters
str[in] message to write

Implements LogWriter.


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