BALL
1.4.79
|
#include <BALL/COMMON/logStream.h>
Classes | |
struct | LoglineStruct |
struct | StreamStruct |
Public Member Functions | |
Constructors and Destructors | |
LogStreamBuf () | |
virtual | ~LogStreamBuf () |
Debugging and Diagnostics | |
virtual void | dump (std::ostream &s) |
Stream methods | |
virtual int | sync () |
int | sync (bool force_flush) |
virtual int | overflow (int c=-1) |
Static Public Attributes | |
Constants | |
static const int | MAX_LEVEL |
static const int | MIN_LEVEL |
static const Time | MAX_TIME |
Protected Types | |
typedef struct LoglineStruct | Logline |
Protected Member Functions | |
string | expandPrefix_ (const string &prefix, int level, Time time) const |
Protected Attributes | |
char * | pbuf_ |
vector< Logline > | loglines_ |
int | level_ |
int | tmp_level_ |
list< StreamStruct > | stream_list_ |
string | incomplete_line_ |
Friends | |
class | LogStream |
Stream buffer used by LogStream. This class implements the low level behaviour of LogStream . It takes care of the buffers and stores the lines written into the LogStream object. It also contains a list of streams that are associated with the LogStream object. This list contains pointers to the streams and their minimum and maximum log level. Each line entered in the LogStream is marked with its time (in fact, the time sync was called) and its loglevel. The loglevel is determined by either the current loglevel (as set by LogStream::setLevel or a temporary level (as set by LogStream::level for a single line only). For each line stored, the list of associated streams is checked whether the loglevel falls into the range declared by the stream's minimum and maximum level. If this condition is met, the logline (with its prefix, see LogStream::setPrefix ) is also copied to the associated stream and this stream is flushed, too.
Definition at line 95 of file logStream.h.
|
protected |
Definition at line 204 of file logStream.h.
BALL::LogStreamBuf::LogStreamBuf | ( | ) |
Default constructor. Create a new LogStreamBuf object.
|
virtual |
Destructor. Destruct the buffer and free all stored messages strings.
|
virtual |
Dump method. Dumps the contents of the whole message buffer including time and log level.
|
protected |
|
virtual |
Overflow method. This method calls sync and streambuf::overflow(c)
to prevent a buffer overflow.
|
virtual |
Sync method. This method is called as soon as the ostream is flushed (especially this method is called by flush or endl). It transfers the contents of the streambufs putbuffer into a logline if a newline or linefeed character is found in the buffer ("\n" or "\r" resp.). The line is then removed from the putbuffer. Incomplete lines (not terminated by "\n" / "\r" are stored in incomplete_line_.
int BALL::LogStreamBuf::sync | ( | bool | force_flush | ) |
|
friend |
Definition at line 99 of file logStream.h.
|
protected |
Definition at line 220 of file logStream.h.
|
protected |
Definition at line 214 of file logStream.h.
|
protected |
Definition at line 212 of file logStream.h.
|
static |
Definition at line 106 of file logStream.h.
|
static |
Definition at line 108 of file logStream.h.
|
static |
Definition at line 107 of file logStream.h.
|
protected |
Definition at line 210 of file logStream.h.
|
protected |
Definition at line 218 of file logStream.h.
|
protected |
Definition at line 216 of file logStream.h.