Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

WvLog Class Reference

#include <wvlog.h>

Inheritance diagram for WvLog:

WvStream WvStream List of all members.

Public Types

enum  LogLevel {
  Critical = 0, Error, Warning, Notice,
  Info, Debug, Debug1 = Debug, Debug2,
  Debug3, Debug4, Debug5, NUM_LOGLEVELS
}
enum  LogLevel {
  Critical = 0, Error, Warning, Notice,
  Info, Debug, Debug1 = Debug, Debug2,
  Debug3, Debug4, Debug5, NUM_LOGLEVELS
}

Public Methods

 WvLog (const WvString &_app, LogLevel _loglevel=Info, const WvLog *par=NULL)
 WvLog (const WvLog &l)
virtual ~WvLog ()
virtual bool isok () const
WvLog & lvl (LogLevel _loglevel)
size_t operator() (LogLevel _loglevel, const WvString &s)
size_t operator() (LogLevel _loglevel, const WvString &__wvs_format, const WvString &__wvs_a0, const WvString &__wvs_a1=__wvs_n, const WvString &__wvs_a2=__wvs_n, const WvString &__wvs_a3=__wvs_n, const WvString &__wvs_a4=__wvs_n, const WvString &__wvs_a5=__wvs_n, const WvString &__wvs_a6=__wvs_n, const WvString &__wvs_a7=__wvs_n, const WvString &__wvs_a8=__wvs_n, const WvString &__wvs_a9=__wvs_n, const WvString &__wvs_a10=__wvs_n, const WvString &__wvs_a11=__wvs_n, const WvString &__wvs_a12=__wvs_n, const WvString &__wvs_a13=__wvs_n, const WvString &__wvs_a14=__wvs_n, const WvString &__wvs_a15=__wvs_n, const WvString &__wvs_a16=__wvs_n, const WvString &__wvs_a17=__wvs_n, const WvString &__wvs_a18=__wvs_n, const WvString &__wvs_a19=__wvs_n)
size_t operator() (const WvString &s)
size_t operator() (const WvString &__wvs_format, const WvString &__wvs_a0, const WvString &__wvs_a1=__wvs_n, const WvString &__wvs_a2=__wvs_n, const WvString &__wvs_a3=__wvs_n, const WvString &__wvs_a4=__wvs_n, const WvString &__wvs_a5=__wvs_n, const WvString &__wvs_a6=__wvs_n, const WvString &__wvs_a7=__wvs_n, const WvString &__wvs_a8=__wvs_n, const WvString &__wvs_a9=__wvs_n, const WvString &__wvs_a10=__wvs_n, const WvString &__wvs_a11=__wvs_n, const WvString &__wvs_a12=__wvs_n, const WvString &__wvs_a13=__wvs_n, const WvString &__wvs_a14=__wvs_n, const WvString &__wvs_a15=__wvs_n, const WvString &__wvs_a16=__wvs_n, const WvString &__wvs_a17=__wvs_n, const WvString &__wvs_a18=__wvs_n, const WvString &__wvs_a19=__wvs_n)
WvLog split (LogLevel _loglevel) const
virtual size_t uwrite (const void *buf, size_t len)
void perror (const WvString &s)
 WvLog (const WvString &_app, LogLevel _loglevel=Info, const WvLog *par=NULL)
 WvLog (const WvLog &l)
virtual ~WvLog ()
virtual bool isok () const
WvLog & lvl (LogLevel _loglevel)
size_t operator() (LogLevel _loglevel, const WvString &s)
size_t operator() (LogLevel _loglevel, WVSTRING_FORMAT_DECL)
size_t operator() (const WvString &s)
size_t operator() (WVSTRING_FORMAT_DECL)
WvLog split (LogLevel _loglevel) const
virtual size_t uwrite (const void *buf, size_t len)
void perror (const WvString &s)

Public Attributes

WvString app

Protected Attributes

const WvLog * parent
LogLevel loglevel
const WvLog * parent

Static Protected Attributes

WvLogRcvBaseList receivers
int num_receivers = 0
int num_logs = 0
WvLogRcvBasedefault_receiver = NULL
WvLogRcvBasedefault_receiver

Friends

class WvLogRcvBase

Detailed Description

A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.

Definition at line 46 of file include/wvlog.h.


Member Enumeration Documentation

enum WvLog::LogLevel
 

Enumeration values:
Critical 
Error 
Warning 
Notice 
Info 
Debug 
Debug1 
Debug2 
Debug3 
Debug4 
Debug5 
NUM_LOGLEVELS 

Definition at line 50 of file streams/wvlog.h.

enum WvLog::LogLevel
 

Enumeration values:
Critical 
Error 
Warning 
Notice 
Info 
Debug 
Debug1 
Debug2 
Debug3 
Debug4 
Debug5 
NUM_LOGLEVELS 

Definition at line 50 of file include/wvlog.h.

Referenced by WvLogRcv::level(), WvLogRcv::log(), lvl(), WvLogBuffer::Msg::Msg(), operator()(), split(), WvLogBuffer::WvLogBuffer(), WvLogConsole::WvLogConsole(), WvLogRcv::WvLogRcv(), and WvSyslog::WvSyslog().


Constructor & Destructor Documentation

WvLog::WvLog const WvString   _app,
LogLevel    _loglevel = Info,
const WvLog *    par = NULL
 

Definition at line 35 of file wvlog.cc.

References app, loglevel, num_logs, parent, and WvString::unique().

Referenced by split().

WvLog::WvLog const WvLog &    l
 

Definition at line 45 of file wvlog.cc.

References app, loglevel, num_logs, and parent.

WvLog::~WvLog   [virtual]
 

Definition at line 54 of file wvlog.cc.

References default_receiver, num_logs, and num_receivers.

WvLog::WvLog const WvString   _app,
LogLevel    _loglevel = Info,
const WvLog *    par = NULL
 

WvLog::WvLog const WvLog &    l
 

virtual WvLog::~WvLog   [virtual]
 


Member Function Documentation

virtual bool WvLog::isok   const [virtual]
 

fd==-1, but this stream is always ok

Reimplemented from WvStream.

bool WvLog::isok   const [virtual]
 

fd==-1, but this stream is always ok

Reimplemented from WvStream.

Definition at line 66 of file wvlog.cc.

WvLog& WvLog::lvl LogLevel    _loglevel [inline]
 

change the loglevel. This returns the object again, so you can make convenient statements like log.lvl(WvLog::Warning).print(...)

Definition at line 88 of file streams/wvlog.h.

References loglevel, and LogLevel.

WvLog& WvLog::lvl LogLevel    _loglevel [inline]
 

change the loglevel. This returns the object again, so you can make convenient statements like log.lvl(WvLog::Warning).print(...)

Definition at line 88 of file include/wvlog.h.

References loglevel, and LogLevel.

Referenced by operator()().

size_t WvLog::operator() WVSTRING_FORMAT_DECL    [inline]
 

Reimplemented from WvStream.

Definition at line 119 of file streams/wvlog.h.

References WvStream::operator()().

size_t WvLog::operator() const WvString   s [inline]
 

although these appear in WvStream, they need to be re-listed for some reason.

Reimplemented from WvStream.

Definition at line 117 of file streams/wvlog.h.

References WvStream::operator()().

size_t WvLog::operator() LogLevel    _loglevel,
WVSTRING_FORMAT_DECL   
[inline]
 

change the loglevel and then print a formatted message

Definition at line 105 of file streams/wvlog.h.

References loglevel, LogLevel, lvl(), and WvStream::print().

size_t WvLog::operator() LogLevel    _loglevel,
const WvString   s
[inline]
 

change the loglevel and then print a message.

Definition at line 94 of file streams/wvlog.h.

References loglevel, LogLevel, lvl(), and WvStream::write().

size_t WvLog::operator() const WvString   __wvs_format,
const WvString   __wvs_a0,
const WvString   __wvs_a1 = __wvs_n,
const WvString   __wvs_a2 = __wvs_n,
const WvString   __wvs_a3 = __wvs_n,
const WvString   __wvs_a4 = __wvs_n,
const WvString   __wvs_a5 = __wvs_n,
const WvString   __wvs_a6 = __wvs_n,
const WvString   __wvs_a7 = __wvs_n,
const WvString   __wvs_a8 = __wvs_n,
const WvString   __wvs_a9 = __wvs_n,
const WvString   __wvs_a10 = __wvs_n,
const WvString   __wvs_a11 = __wvs_n,
const WvString   __wvs_a12 = __wvs_n,
const WvString   __wvs_a13 = __wvs_n,
const WvString   __wvs_a14 = __wvs_n,
const WvString   __wvs_a15 = __wvs_n,
const WvString   __wvs_a16 = __wvs_n,
const WvString   __wvs_a17 = __wvs_n,
const WvString   __wvs_a18 = __wvs_n,
const WvString   __wvs_a19 = __wvs_n
[inline]
 

Reimplemented from WvStream.

Definition at line 119 of file include/wvlog.h.

References WvStream::operator()().

size_t WvLog::operator() const WvString   s [inline]
 

although these appear in WvStream, they need to be re-listed for some reason.

Reimplemented from WvStream.

Definition at line 117 of file include/wvlog.h.

References WvStream::operator()().

size_t WvLog::operator() LogLevel    _loglevel,
const WvString   __wvs_format,
const WvString   __wvs_a0,
const WvString   __wvs_a1 = __wvs_n,
const WvString   __wvs_a2 = __wvs_n,
const WvString   __wvs_a3 = __wvs_n,
const WvString   __wvs_a4 = __wvs_n,
const WvString   __wvs_a5 = __wvs_n,
const WvString   __wvs_a6 = __wvs_n,
const WvString   __wvs_a7 = __wvs_n,
const WvString   __wvs_a8 = __wvs_n,
const WvString   __wvs_a9 = __wvs_n,
const WvString   __wvs_a10 = __wvs_n,
const WvString   __wvs_a11 = __wvs_n,
const WvString   __wvs_a12 = __wvs_n,
const WvString   __wvs_a13 = __wvs_n,
const WvString   __wvs_a14 = __wvs_n,
const WvString   __wvs_a15 = __wvs_n,
const WvString   __wvs_a16 = __wvs_n,
const WvString   __wvs_a17 = __wvs_n,
const WvString   __wvs_a18 = __wvs_n,
const WvString   __wvs_a19 = __wvs_n
[inline]
 

change the loglevel and then print a formatted message

Definition at line 105 of file include/wvlog.h.

References loglevel, LogLevel, lvl(), and WvStream::print().

size_t WvLog::operator() LogLevel    _loglevel,
const WvString   s
[inline]
 

change the loglevel and then print a message.

Definition at line 94 of file include/wvlog.h.

References loglevel, LogLevel, lvl(), and WvStream::write().

void WvLog::perror const WvString   s [inline]
 

a useful substitute for the normal C perror() function

Definition at line 139 of file streams/wvlog.h.

References WvStream::print().

void WvLog::perror const WvString   s [inline]
 

a useful substitute for the normal C perror() function

Definition at line 139 of file include/wvlog.h.

References WvStream::print().

Referenced by WvInterface::addarp(), WvInterface::addroute(), WvInterface::delroute(), WvInterface::setflags(), WvInterface::setipaddr(), and WvInterface::setmtu().

WvLog WvLog::split LogLevel    _loglevel const [inline]
 

split off a new WvLog object with the requested loglevel. This way you can have log at two or more levels without having to retype log.lvl(WvLog::blahblah) all the time.

Definition at line 127 of file streams/wvlog.h.

References LogLevel, and WvLog().

WvLog WvLog::split LogLevel    _loglevel const [inline]
 

split off a new WvLog object with the requested loglevel. This way you can have log at two or more levels without having to retype log.lvl(WvLog::blahblah) all the time.

Definition at line 127 of file include/wvlog.h.

References LogLevel, and WvLog().

Referenced by WvInterfaceDict::update().

virtual size_t WvLog::uwrite const void *    buf,
size_t    len
[virtual]
 

we override the unbuffered write function, so lines also include the application and log level.

Reimplemented from WvStream.

size_t WvLog::uwrite const void *    buf,
size_t    len
[virtual]
 

we override the unbuffered write function, so lines also include the application and log level.

Reimplemented from WvStream.

Definition at line 72 of file wvlog.cc.

References default_receiver, WvLogRcvBase::log(), loglevel, num_receivers, parent, and receivers.


Friends And Related Function Documentation

WvLogRcvBase [friend]
 

Definition at line 48 of file include/wvlog.h.


Member Data Documentation

WvString WvLog::app
 

Definition at line 64 of file streams/wvlog.h.

Referenced by WvLogBuffer::_begin_line(), WvLogRcvBase::appname(), and WvLog().

WvLogRcvBase* WvLog::default_receiver [static, protected]
 

Definition at line 71 of file streams/wvlog.h.

WvLogRcvBase * WvLog::default_receiver = NULL [static, protected]
 

Definition at line 14 of file wvlog.cc.

Referenced by uwrite(), and ~WvLog().

LogLevel WvLog::loglevel [protected]
 

Definition at line 68 of file streams/wvlog.h.

Referenced by lvl(), operator()(), uwrite(), and WvLog().

int WvLog::num_logs = 0 [static, protected]
 

Definition at line 70 of file streams/wvlog.h.

Referenced by WvLog(), and ~WvLog().

int WvLog::num_receivers = 0 [static, protected]
 

Definition at line 70 of file streams/wvlog.h.

Referenced by uwrite(), WvLogRcvBase::WvLogRcvBase(), ~WvLog(), and WvLogRcvBase::~WvLogRcvBase().

const WvLog* WvLog::parent [protected]
 

Definition at line 67 of file streams/wvlog.h.

const WvLog* WvLog::parent [protected]
 

Definition at line 67 of file include/wvlog.h.

Referenced by uwrite(), and WvLog().

WvLogRcvBaseList WvLog::receivers [static, protected]
 

Definition at line 69 of file streams/wvlog.h.

Referenced by uwrite(), WvLogRcvBase::WvLogRcvBase(), and WvLogRcvBase::~WvLogRcvBase().


The documentation for this class was generated from the following files:
Generated on Sat Aug 24 23:08:03 2002 for WvStreams by doxygen1.2.15