21 #include "wvfdstream.h"
22 #include "wvscatterhash.h"
32 WvLog::LogLevel max_level, last_level;
44 lvl((WvLog::LogLevel)_lvl) {};
49 Src_LvlDict custom_levels;
65 virtual void _mid_line(
const char *str,
size_t len) = 0;
69 {
if (!at_newline)
return;
_begin_line(); at_newline =
false; }
70 void mid_line(
const char *str,
size_t len)
72 if (len>0 && str[len-1] ==
'\n') at_newline =
true; }
75 virtual void log(WvStringParm source,
int loglevel,
76 const char *_buf,
size_t len);
78 static const char *loglevels[WvLog::NUM_LOGLEVELS];
80 WvLogRcv(WvLog::LogLevel _max_level = WvLog::NUM_LOGLEVELS);
84 {
if (at_newline)
return;
87 WvLog::LogLevel level()
const
89 void level(WvLog::LogLevel lvl)
99 bool set_custom_levels(
WvString descr);
111 WvLog::LogLevel _max_level = WvLog::NUM_LOGLEVELS);
114 virtual void _mid_line(
const char *str,
size_t len);
117 #endif // __WVLOGRCV_H
Captures formatted log messages and outputs them to the specified file descriptor.
virtual void _mid_line(const char *str, size_t len)
add text to the current log line.
virtual void _mid_line(const char *str, size_t len)=0
add text to the current log line.
WvString is an implementation of a simple and efficient printable-string class.
virtual void _end_line()
End this (Guaranteed NonEmpty) log line.
WvLogRcv adds some intelligence to WvLogRcvBase, to keep track of line-prefix-printing and other form...
virtual void _make_prefix(time_t now)
Set the Prefix and Prefix Length (size_t prelen)
Base class for streams built on Unix file descriptors.
virtual void _begin_line()
Start a new log line (print prefix)