WvStreams
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
WvLogStream Class Reference

A WvLogRcv that sends its log messages to any supplied WvStream. More...

#include <wvlogstream.h>

Inheritance diagram for WvLogStream:
Inheritance graph
[legend]

Public Member Functions

 WvLogStream (IWvStream *s, WvLog::LogLevel _max_level=WvLog::NUM_LOGLEVELS)
 
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

virtual void _mid_line (const char *str, size_t len)
 add text to the current log line. More...
 
 DeclareWvScatterDict (Src_Lvl, WvString, src)
 
virtual void _make_prefix (time_t now)
 Set the Prefix and Prefix Length (size_t prelen)
 
virtual void _begin_line ()
 Start a new log line (print prefix)
 
virtual void _end_line ()
 End this (Guaranteed NonEmpty) log line.
 
const char * appname (WvStringParm log) const
 

Protected Attributes

IWvStreamcloned
 
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
 

Detailed Description

A WvLogRcv that sends its log messages to any supplied WvStream.

Takes ownership of the given stream, so it will be release()d when this object goes away.

Definition at line 12 of file wvlogstream.h.

Member Function Documentation

◆ _mid_line()

void WvLogStream::_mid_line ( const char *  str,
size_t  len 
)
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 17 of file wvlogstream.cc.

Member Data Documentation

◆ loglevels

const char * WvLogRcv::loglevels
staticinherited
Initial value:
= {
"Crit",
"Err",
"Warn",
"Notice",
"Info",
"*1",
"*2",
"*3",
"*4",
"*5",
}

Definition at line 78 of file wvlogrcv.h.


The documentation for this class was generated from the following files: