Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

WvLogRcv Class Reference

#include <wvlogrcv.h>

Inherits WvLogRcvBase.

Inherited by WvLogBuffer, WvLogConsole, WvLogFileBase, WvSyslog, and WvWinDebugLog.

Collaboration diagram for WvLogRcv:

[legend]
List of all members.

Detailed Description

WvLogRcv adds some intelligence to WvLogRcvBase, to keep track of line-prefix-printing and other formatting information.

Definition at line 28 of file wvlogrcv.h.

Public Member Functions

 WvLogRcv (WvLog::LogLevel _max_level=WvLog::NUM_LOGLEVELS)
virtual ~WvLogRcv ()
void end_line ()
WvLog::LogLevel level () const
void level (WvLog::LogLevel lvl)
bool set_custom_levels (WvString descr)

Static Public Attributes

char * loglevels [WvLog::NUM_LOGLEVELS]

Protected Member Functions

 DeclareWvDict (Src_Lvl, WvString, src)
virtual void log (const WvLog *source, int loglevel, const char *_buf, size_t len)
virtual void _make_prefix ()
 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.
virtual void _mid_line (const char *str, size_t len)=0
 add text to the current log line.
const char * appname (const WvLog *log) const

Protected Attributes

const WvLoglast_source
WvLog::LogLevel max_level
WvLog::LogLevel last_level
bool at_newline
WvString prefix
size_t prelen
Src_LvlDict custom_levels


Constructor & Destructor Documentation

WvLogRcv::WvLogRcv WvLog::LogLevel  _max_level = WvLog::NUM_LOGLEVELS  ) 
 

Definition at line 151 of file wvlog.cc.

References at_newline, last_level, last_source, and max_level.

WvLogRcv::~WvLogRcv  )  [virtual]
 

Definition at line 160 of file wvlog.cc.


Member Function Documentation

void WvLogRcv::_begin_line  )  [protected, virtual]
 

Start a new log line (print prefix).

Reimplemented in WvLogBuffer, and WvSyslog.

Definition at line 173 of file wvlog.cc.

References prefix, and prelen.

void WvLogRcv::_end_line  )  [protected, virtual]
 

End this (Guaranteed NonEmpty) log line.

Reimplemented in WvLogBuffer, and WvSyslog.

Definition at line 179 of file wvlog.cc.

Referenced by end_line().

void WvLogRcv::_make_prefix  )  [protected, virtual]
 

Set the Prefix and Prefix Length (size_t prelen).

Reimplemented in WvLogFileBase.

Definition at line 165 of file wvlog.cc.

References WvLogRcvBase::appname(), last_level, last_source, WvFastString::len(), loglevels, prefix, and prelen.

Referenced by log().

virtual void WvLogRcv::_mid_line const char *  str,
size_t  len
[protected, pure virtual]
 

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.

Implemented in WvLogBuffer, WvLogFileBase, WvLogConsole, and WvSyslog.

Referenced by end_line().

const char * WvLogRcvBase::appname const WvLog log  )  const [protected, inherited]
 

Definition at line 140 of file wvlog.cc.

References WvLog::app, and log.

Referenced by WvLogFileBase::_make_prefix(), and _make_prefix().

WvLogRcv::DeclareWvDict Src_Lvl  ,
WvString  ,
src 
[protected]
 

void WvLogRcv::end_line  )  [inline]
 

Definition at line 82 of file wvlogrcv.h.

References _end_line(), _mid_line(), and at_newline.

Referenced by log(), WvLogBuffer::messages(), WvLogBuffer::~WvLogBuffer(), WvLogConsole::~WvLogConsole(), and WvSyslog::~WvSyslog().

void WvLogRcv::level WvLog::LogLevel  lvl  )  [inline]
 

Definition at line 88 of file wvlogrcv.h.

References max_level.

WvLog::LogLevel WvLogRcv::level  )  const [inline]
 

Definition at line 86 of file wvlogrcv.h.

Referenced by main().

void WvLogRcv::log const WvLog source,
int  loglevel,
const char *  _buf,
size_t  len
[protected, virtual]
 

Implements WvLogRcvBase.

Definition at line 197 of file wvlog.cc.

References _make_prefix(), WvLog::app, custom_levels, WvString::edit(), end_line(), last_level, last_source, my_isprint(), and strlwr().

bool WvLogRcv::set_custom_levels WvString  descr  ) 
 

Definition at line 290 of file wvlog.cc.

References custom_levels, WvString::edit(), WvStringList::split(), strlwr(), and trim_string().


Member Data Documentation

bool WvLogRcv::at_newline [protected]
 

Definition at line 33 of file wvlogrcv.h.

Referenced by end_line(), and WvLogRcv().

Src_LvlDict WvLogRcv::custom_levels [protected]
 

Definition at line 48 of file wvlogrcv.h.

Referenced by log(), and set_custom_levels().

WvLog::LogLevel WvLogRcv::last_level [protected]
 

Definition at line 32 of file wvlogrcv.h.

Referenced by _make_prefix(), log(), and WvLogRcv().

const WvLog* WvLogRcv::last_source [protected]
 

Definition at line 31 of file wvlogrcv.h.

Referenced by _make_prefix(), log(), and WvLogRcv().

char * WvLogRcv::loglevels [static]
 

Initial value:

 {
    "Crit",
    "Err",
    "Warn",
    "Notice",
    "Info",
    "*1",
    "*2",
    "*3",
    "*4",
    "*5",
}

Definition at line 23 of file wvlog.cc.

Referenced by _make_prefix().

WvLog::LogLevel WvLogRcv::max_level [protected]
 

Definition at line 32 of file wvlogrcv.h.

Referenced by level(), and WvLogRcv().

WvString WvLogRcv::prefix [protected]
 

Definition at line 34 of file wvlogrcv.h.

Referenced by _begin_line(), and _make_prefix().

size_t WvLogRcv::prelen [protected]
 

Definition at line 35 of file wvlogrcv.h.

Referenced by _begin_line(), and _make_prefix().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 15:08:20 2004 for WvStreams by  doxygen 1.3.9.1