A logstream is an ostream useful for logging. More...
#include <logstream.h>
Classes | |
class | LogFilter |
Implements Filter interface for filterstreambuf. More... | |
Public Member Functions | |
logstream (const std::string &path, const std::string &prefix) | |
Creates ofstream for path. | |
logstream (std::ostream &stream, const std::string &prefix) | |
Constructor. | |
~logstream () | |
Destructor. | |
const std::string & | prefix () const |
void | prefix (const std::string &s) |
Private Attributes | |
LogFilter | filter_ |
A logstream is an ostream useful for logging.
Each line is preceeded by the date and an application-determined identification string.
Definition at line 29 of file logstream.h.
Dv::Util::logstream::logstream | ( | const std::string & | path, | |
const std::string & | prefix | |||
) |
Creates ofstream for path.
The stream will be opened with mode ios:app, i.e. a seek to the end of the stream will be performed before each output operation.
path | on which log output will be written. | |
prefix | each output line will start with the date and this prefix string |
Dv::Util::logstream::logstream | ( | std::ostream & | stream, | |
const std::string & | prefix | |||
) |
Constructor.
stream | existing stream on which output will be written. | |
prefix | each output line will start with the date and this prefix string |
Dv::Util::logstream::~logstream | ( | ) |
Destructor.
const std::string& Dv::Util::logstream::prefix | ( | ) | const [inline] |
Definition at line 117 of file logstream.h.
References filter_, and Dv::Util::logstream::LogFilter::prefix().
void Dv::Util::logstream::prefix | ( | const std::string & | s | ) | [inline] |
s | prefix that is put at the start of each line. |
Definition at line 122 of file logstream.h.
References filter_, and Dv::Util::logstream::LogFilter::prefix().
LogFilter Dv::Util::logstream::filter_ [private] |
Definition at line 124 of file logstream.h.
Referenced by prefix().
dvutil-1.0.10 | [ 5 December, 2009] |