WvStreams
|
WvLogBuffer is a descendant of WvLogRcv that buffers log messages for later use. More...
#include <wvlogbuffer.h>
Classes | |
class | Msg |
class | MsgCounter |
Public Member Functions | |
DeclareWvList (Msg) | |
DeclareWvDict (MsgCounter, WvString, src_lvl) | |
WvLogBuffer (int _max_lines, WvLog::LogLevel _max_level=WvLog::NUM_LOGLEVELS) | |
MsgList & | messages () |
void | feed_receiver (WvLogRcv &receiver) |
void | dump (WvStream &s) |
virtual void | log (WvStringParm source, int loglevel, const char *_buf, size_t len) |
void | end_line () |
WvLog::LogLevel | level () const |
void | level (WvLog::LogLevel lvl) |
bool | set_custom_levels (WvString descr) |
Public Attributes | |
bool | force_new_line |
Static Public Attributes | |
static const char * | loglevels [WvLog::NUM_LOGLEVELS] |
Protected Member Functions | |
void | handle_msg (Msg *lastmsg) |
virtual void | _begin_line () |
Start a new log line (print prefix) More... | |
virtual void | _mid_line (const char *str, size_t len) |
add text to the current log line. More... | |
virtual void | _end_line () |
End this (Guaranteed NonEmpty) log line. More... | |
DeclareWvScatterDict (Src_Lvl, WvString, src) | |
virtual void | _make_prefix (time_t now) |
Set the Prefix and Prefix Length (size_t prelen) More... | |
const char * | appname (WvStringParm log) const |
Protected Attributes | |
MsgList | msgs |
MsgCounterDict | counters |
WvDynBuf | current |
int | max_lines |
WvString | last_source |
WvLog::LogLevel | max_level |
WvLog::LogLevel | last_level |
time_t | last_time |
bool | at_newline |
WvString | prefix |
size_t | prelen |
Src_LvlDict | custom_levels |
WvLogBuffer is a descendant of WvLogRcv that buffers log messages for later use.
It only keeps up to max_lines log entries for every source/debug level, s.t. debug level <= max_level
Definition at line 17 of file wvlogbuffer.h.
WvLogBuffer::WvLogBuffer | ( | int | _max_lines, |
WvLog::LogLevel | _max_level = WvLog::NUM_LOGLEVELS |
||
) |
Definition at line 35 of file wvlogbuffer.cc.
|
virtual |
Definition at line 42 of file wvlogbuffer.cc.
|
protected |
Definition at line 53 of file wvlogbuffer.cc.
|
inlineprotectedvirtual |
Start a new log line (print prefix)
Reimplemented from WvLogRcv.
Definition at line 64 of file wvlogbuffer.h.
|
protectedvirtual |
add text to the current log line.
'str' may contain only one '
' optional character at str[len-1] (the end); if it does, end_line will be called immediately after this function.
Implements WvLogRcv.
Definition at line 48 of file wvlogbuffer.cc.
|
protectedvirtual |
End this (Guaranteed NonEmpty) log line.
Reimplemented from WvLogRcv.
Definition at line 75 of file wvlogbuffer.cc.
References WvBufBaseCommonImpl< T >::get(), trim_string(), WvBufBaseCommonImpl< T >::used(), and WvBufBaseCommonImpl< T >::zap().
|
inline |
Definition at line 73 of file wvlogbuffer.h.
void WvLogBuffer::feed_receiver | ( | WvLogRcv & | receiver | ) |
Definition at line 89 of file wvlogbuffer.cc.
void WvLogBuffer::dump | ( | WvStream & | s | ) |
Definition at line 102 of file wvlogbuffer.cc.
|
protectedvirtualinherited |
Set the Prefix and Prefix Length (size_t prelen)
Reimplemented in WvCrashLog, and WvLogFileBase.
|
virtualinherited |
Implements WvLogRcvBase.
|
inlineinherited |
Definition at line 83 of file wvlogrcv.h.
|
inlineinherited |
Definition at line 87 of file wvlogrcv.h.
|
inlineinherited |
Definition at line 89 of file wvlogrcv.h.
|
inherited |
|
protectedinherited |
|
protected |
Definition at line 53 of file wvlogbuffer.h.
|
protected |
Definition at line 58 of file wvlogbuffer.h.
|
protected |
Definition at line 59 of file wvlogbuffer.h.
|
protected |
Definition at line 60 of file wvlogbuffer.h.
|
protectedinherited |
Definition at line 31 of file wvlogrcv.h.
|
protectedinherited |
Definition at line 32 of file wvlogrcv.h.
|
protectedinherited |
Definition at line 32 of file wvlogrcv.h.
|
protectedinherited |
Definition at line 33 of file wvlogrcv.h.
|
protectedinherited |
Definition at line 34 of file wvlogrcv.h.
|
protectedinherited |
Definition at line 35 of file wvlogrcv.h.
|
protectedinherited |
Definition at line 36 of file wvlogrcv.h.
|
protectedinherited |
Definition at line 49 of file wvlogrcv.h.
|
staticinherited |
Definition at line 78 of file wvlogrcv.h.