RobWorkProject
23.9.11-
|
Writes log output to a std::ostream. More...
#include <LogStreamWriter.hpp>
Inherits LogWriter.
Public Member Functions | |
LogStreamWriter (std::ostream *stream) | |
Constructs LogStreamWriter with a target output stream. More... | |
~LogStreamWriter () | |
Destructor. More... | |
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 > | |
LogWriter & | operator<< (T t) |
general stream operator | |
LogWriter & | operator<< (const std::string &str) |
specialized stream operator 2 | |
LogWriter & | operator<< (const Message &msg) |
Write Message to log. More... | |
LogWriter & | operator<< (const char *str) |
specialized stream operator | |
LogWriter & | operator<< (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< LogWriter > | Ptr |
smart pointer type to this class | |
Writes log output to a std::ostream.
LogStreamWriter | ( | std::ostream * | stream | ) |
Constructs LogStreamWriter with a target output stream.
The LogStreamWriter keeps a reference to the stream object. Destroying the stream object while the LogStreamWriter has a reference to it results in undefined behavior.
Ownership of the stream is not taken.
stream | [in] Stream to write to |
~LogStreamWriter | ( | ) |
Destructor.
Calls flush on the output stream before destruction
|
protectedvirtual |
Set the tab level.
Implements LogWriter.
|
protectedvirtual |