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

WvSyslog is a descendant of WvLogRcv that sends messages to the syslogd daemon. More...

#include <wvsyslog.h>

Inheritance diagram for WvSyslog:
Inheritance graph
[legend]

Public Member Functions

 WvSyslog (WvStringParm _prefix, bool _include_appname, WvLog::LogLevel _first_debug=WvLog::Debug, 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 _begin_line ()
 Start a new log line (print prefix)
 
virtual void _mid_line (const char *str, size_t len)
 add text to the current log line.
 
virtual void _end_line ()
 End this (Guaranteed NonEmpty) log line.
 
 DeclareWvScatterDict (Src_Lvl, WvString, src)
 
virtual void _make_prefix (time_t now)
 Set the Prefix and Prefix Length (size_t prelen)
 
const char * appname (WvStringParm log) const
 

Protected Attributes

WvLog::LogLevel first_debug
 
WvDynBuf current
 
WvString syslog_prefix
 
bool include_appname
 
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

WvSyslog is a descendant of WvLogRcv that sends messages to the syslogd daemon.

Definition at line 15 of file wvsyslog.h.

Constructor & Destructor Documentation

◆ WvSyslog()

WvSyslog::WvSyslog ( WvStringParm  _prefix,
bool  _include_appname,
WvLog::LogLevel  _first_debug = WvLog::Debug,
WvLog::LogLevel  _max_level = WvLog::NUM_LOGLEVELS 
)

Definition at line 13 of file wvsyslog.cc.

◆ ~WvSyslog()

WvSyslog::~WvSyslog ( )
virtual

Definition at line 24 of file wvsyslog.cc.

Member Function Documentation

◆ _begin_line()

void WvSyslog::_begin_line ( )
protectedvirtual

Start a new log line (print prefix)

Reimplemented from WvLogRcv.

Definition at line 31 of file wvsyslog.cc.

References WvBufBaseCommonImpl< T >::put().

◆ _mid_line()

void WvSyslog::_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 38 of file wvsyslog.cc.

References WvBufBaseCommonImpl< T >::put().

◆ _end_line()

void WvSyslog::_end_line ( )
protectedvirtual

End this (Guaranteed NonEmpty) log line.

Reimplemented from WvLogRcv.

Definition at line 44 of file wvsyslog.cc.

References WvBufBaseCommonImpl< T >::get(), WvBufBaseCommonImpl< T >::put(), WvBufBaseCommonImpl< T >::used(), and WvBufBaseCommonImpl< T >::zap().

◆ _make_prefix()

void WvLogRcv::_make_prefix ( time_t  now)
protectedvirtualinherited

Set the Prefix and Prefix Length (size_t prelen)

Reimplemented in WvCrashLog, and WvLogFileBase.

Definition at line 240 of file wvlog.cc.

◆ log()

void WvLogRcv::log ( WvStringParm  source,
int  loglevel,
const char *  _buf,
size_t  len 
)
virtualinherited

Implements WvLogRcvBase.

Definition at line 272 of file wvlog.cc.

◆ end_line()

void WvLogRcv::end_line ( )
inlineinherited

Definition at line 83 of file wvlogrcv.h.

◆ level() [1/2]

WvLog::LogLevel WvLogRcv::level ( ) const
inlineinherited

Definition at line 87 of file wvlogrcv.h.

◆ level() [2/2]

void WvLogRcv::level ( WvLog::LogLevel  lvl)
inlineinherited

Definition at line 89 of file wvlogrcv.h.

◆ set_custom_levels()

bool WvLogRcv::set_custom_levels ( WvString  descr)
inherited

Definition at line 379 of file wvlog.cc.

◆ appname()

const char * WvLogRcvBase::appname ( WvStringParm  log) const
protectedinherited

Definition at line 186 of file wvlog.cc.

Member Data Documentation

◆ first_debug

WvLog::LogLevel WvSyslog::first_debug
protected

Definition at line 24 of file wvsyslog.h.

◆ current

WvDynBuf WvSyslog::current
protected

Definition at line 25 of file wvsyslog.h.

◆ syslog_prefix

WvString WvSyslog::syslog_prefix
protected

Definition at line 26 of file wvsyslog.h.

◆ include_appname

bool WvSyslog::include_appname
protected

Definition at line 27 of file wvsyslog.h.

◆ last_source

WvString WvLogRcv::last_source
protectedinherited

Definition at line 31 of file wvlogrcv.h.

◆ max_level

WvLog::LogLevel WvLogRcv::max_level
protectedinherited

Definition at line 32 of file wvlogrcv.h.

◆ last_level

WvLog::LogLevel WvLogRcv::last_level
protectedinherited

Definition at line 32 of file wvlogrcv.h.

◆ last_time

time_t WvLogRcv::last_time
protectedinherited

Definition at line 33 of file wvlogrcv.h.

◆ at_newline

bool WvLogRcv::at_newline
protectedinherited

Definition at line 34 of file wvlogrcv.h.

◆ prefix

WvString WvLogRcv::prefix
protectedinherited

Definition at line 35 of file wvlogrcv.h.

◆ prelen

size_t WvLogRcv::prelen
protectedinherited

Definition at line 36 of file wvlogrcv.h.

◆ custom_levels

Src_LvlDict WvLogRcv::custom_levels
protectedinherited

Definition at line 49 of file wvlogrcv.h.

◆ loglevels

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

Definition at line 24 of file wvlogrcv.h.

◆ force_new_line

bool WvLogRcvBase::force_new_line
inherited

Definition at line 42 of file wvlog.h.


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