Loxahatchee  v0.0.1-1346
Lox Convenience C++ Library
Lox::Log Class Reference

Logging system, uses syslog on posix and normal logging on Windows. More...

#include <LoxLog.hpp>

Collaboration diagram for Lox::Log:

Public Types

enum  EFacility {
  kInvalid,
  kDaemon = LOG_DAEMON,
  kLocal0 = LOG_LOCAL0,
  kLocal1 = LOG_LOCAL1,
  kLocal2 = LOG_LOCAL2,
  kLocal3 = LOG_LOCAL3,
  kLocal4 = LOG_LOCAL4,
  kLocal5 = LOG_LOCAL5,
  kLocal6 = LOG_LOCAL6,
  kLocal7 = LOG_LOCAL7,
  kSyslog = LOG_SYSLOG,
  kUser = LOG_USER
}
 C++ aliases for some common Linux syslog facilities. Unused on Windows. More...
 
enum  EPriority {
  kUnknown,
  kEmergency = LOG_EMERG,
  kEmerg = LOG_EMERG,
  kAlert = LOG_ALERT,
  kCritical = LOG_CRIT,
  kCrit = LOG_CRIT,
  kError = LOG_ERR,
  kErr = LOG_ERR,
  kWarning = LOG_WARNING,
  kWarn = LOG_WARNING,
  kNotice = LOG_NOTICE,
  kInfo = LOG_INFO,
  kDebug = LOG_DEBUG
}
 C++ aliases for the usual log priority levels are based on syslog. More...
 

Public Member Functions

 Log (const std::string &name, const EFacility facility=kUser)
 Constructor. More...
 
virtual ~Log (void)
 Destructor. More...
 
virtual Logdisable (const EPriority priority)
 Disable logging of the specified message priority. This calls setlogmask(). More...
 
virtual Logenable (const EPriority priority)
 Enable logging of the specified message priority. This calls setlogmask(). By default, all priorities are enabled. More...
 
virtual LogenableAll (void)
 Enable all priority levels at once. All levels are enabled by default when the process starts (but also see /etc/rsyslog.conf). More...
 

Static Public Member Functions

static void log (const EPriority priority, const std::string &msg)
 Log the specified message at the given priority. More...
 
static void log (const EPriority priority, const char *format,...)
 Log a message using the usual printf-style formatting. More...
 
static void log (const EPriority priority, const char *format, va_list ap)
 Intended mostly for internal use. See the other variadic logging methods instead. More...
 
Simple

Simple logging methods for each of the priority levels.

static void debug (const std::string &msg)
 Debug. Can be used to facilitate debugging. There will likely be many of these generated. More...
 
static void info (const std::string &msg)
 Info. Can be used to facilitate debugging. There may be many of these generated. More...
 
static void notice (const std::string &msg)
 Notice. Normal log message. Everything seems to be working correctly. More...
 
static void warn (const std::string &msg)
 Warn. Same as warning(). Indicates a minor issue which may need to be brought to the user's attention. More...
 
static void warning (const std::string &msg)
 Warning. Same as warn(). Indicates a minor issue which may need to be brought to the user's attention. More...
 
static void err (const std::string &msg)
 Err. Same as error(). Indicates an error condition. The application will attempt to work around it. More...
 
static void error (const std::string &msg)
 Error. Same as err(). Indicates an error condition. The application will attempt to work around it. More...
 
static void crit (const std::string &msg)
 Crit. Same as critical(). Indicates a serious problem. More...
 
static void critical (const std::string &msg)
 Critical. Same as crit(). Indicates a serious problem. More...
 
static void alert (const std::string &msg)
 Alert. Indicates a serious unexpected condition. Process will likely abort. More...
 
static void emerg (const std::string &msg)
 Emerg. Same as emergency(). Indicates the process is aborting. More...
 
static void emergency (const std::string &msg)
 Emergency. Same as emerg(). Indicates the process is aborting. More...
 
Variadic

Variadic logging methods for each of the priority levels.

See the related simpler methods for additional details.

static void debug (const char *format,...)
 
static void info (const char *format,...)
 
static void notice (const char *format,...)
 
static void warn (const char *format,...)
 
static void warning (const char *format,...)
 
static void err (const char *format,...)
 
static void error (const char *format,...)
 
static void crit (const char *format,...)
 
static void critical (const char *format,...)
 
static void alert (const char *format,...)
 
static void emerg (const char *format,...)
 
static void emergency (const char *format,...)
 
Exceptions

Several static methods to log Lox::Exceptions.

static void log (const EPriority priority, const Lox::Exception &e)
 
static void debug (const Lox::Exception &e)
 
static void info (const Lox::Exception &e)
 
static void notice (const Lox::Exception &e)
 
static void warning (const Lox::Exception &e)
 
static void error (const Lox::Exception &e)
 
static void critical (const Lox::Exception &e)
 
static void alert (const Lox::Exception &e)
 
static void emergency (const Lox::Exception &e)
 

Protected Attributes

std::string ident
 

Detailed Description

Logging system, uses syslog on posix and normal logging on Windows.

Member Enumeration Documentation

C++ aliases for some common Linux syslog facilities. Unused on Windows.

Enumerator
kInvalid 
kDaemon 
kLocal0 
kLocal1 
kLocal2 
kLocal3 
kLocal4 
kLocal5 
kLocal6 
kLocal7 
kSyslog 
kUser 

C++ aliases for the usual log priority levels are based on syslog.

Enumerator
kUnknown 
kEmergency 

System is unusable.

kEmerg 

There is no difference between kEmerg and kEmergency.

kAlert 

Action must be taken immediately.

kCritical 

Critical conditions.

kCrit 

There is no difference between kCrit and kCritical.

kError 

Error conditions.

kErr 

There is no difference between kErr and kError.

kWarning 

Warning conditions.

kWarn 

There is no difference between kWarn and kWarning.

kNotice 

Normal but significant condition.

kInfo 

Informational.

kDebug 

Debug-level messages.

Constructor & Destructor Documentation

Lox::Log::~Log ( void  )
virtual

Destructor.

Todo:
Lox::Log::Log ( const std::string &  name,
const EFacility  facility = kUser 
)

Constructor.

Parameters
[in]nameThe process name syslog will use when logging a message.
[in]facilityWhere syslog will log messages. Note this is also affected by /etc/rsyslog.conf.

References ident.

Member Function Documentation

static void Lox::Log::alert ( const std::string &  msg)
inlinestatic

Alert. Indicates a serious unexpected condition. Process will likely abort.

References kAlert, and log().

Here is the call graph for this function:

void Lox::Log::alert ( const char *  format,
  ... 
)
static
static void Lox::Log::alert ( const Lox::Exception e)
inlinestatic

References kAlert, and log().

Here is the call graph for this function:

static void Lox::Log::crit ( const std::string &  msg)
inlinestatic

Crit. Same as critical(). Indicates a serious problem.

References kCrit, and log().

Here is the call graph for this function:

void Lox::Log::crit ( const char *  format,
  ... 
)
static
static void Lox::Log::critical ( const std::string &  msg)
inlinestatic

Critical. Same as crit(). Indicates a serious problem.

References kCritical, and log().

Referenced by Lox::Exception::initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

void Lox::Log::critical ( const char *  format,
  ... 
)
static
static void Lox::Log::critical ( const Lox::Exception e)
inlinestatic

References kCritical, and log().

Here is the call graph for this function:

static void Lox::Log::debug ( const std::string &  msg)
inlinestatic

Debug. Can be used to facilitate debugging. There will likely be many of these generated.

void Lox::Log::debug ( const char *  format,
  ... 
)
static
static void Lox::Log::debug ( const Lox::Exception e)
inlinestatic

References kDebug, and log().

Here is the call graph for this function:

Lox::Log & Lox::Log::disable ( const EPriority  priority)
virtual

Disable logging of the specified message priority. This calls setlogmask().

Todo:
static void Lox::Log::emerg ( const std::string &  msg)
inlinestatic

Emerg. Same as emergency(). Indicates the process is aborting.

References kEmerg, and log().

Here is the call graph for this function:

void Lox::Log::emerg ( const char *  format,
  ... 
)
static
static void Lox::Log::emergency ( const std::string &  msg)
inlinestatic

Emergency. Same as emerg(). Indicates the process is aborting.

References kEmergency, and log().

Here is the call graph for this function:

void Lox::Log::emergency ( const char *  format,
  ... 
)
static
static void Lox::Log::emergency ( const Lox::Exception e)
inlinestatic

References kEmergency, and log().

Here is the call graph for this function:

Lox::Log & Lox::Log::enable ( const EPriority  priority)
virtual

Enable logging of the specified message priority. This calls setlogmask(). By default, all priorities are enabled.

Todo:
Lox::Log & Lox::Log::enableAll ( void  )
virtual

Enable all priority levels at once. All levels are enabled by default when the process starts (but also see /etc/rsyslog.conf).

Todo:
static void Lox::Log::err ( const std::string &  msg)
inlinestatic

Err. Same as error(). Indicates an error condition. The application will attempt to work around it.

References kErr, and log().

Here is the call graph for this function:

void Lox::Log::err ( const char *  format,
  ... 
)
static
static void Lox::Log::error ( const std::string &  msg)
inlinestatic

Error. Same as err(). Indicates an error condition. The application will attempt to work around it.

References kError, and log().

Here is the call graph for this function:

void Lox::Log::error ( const char *  format,
  ... 
)
static
static void Lox::Log::error ( const Lox::Exception e)
inlinestatic

References kError, and log().

Here is the call graph for this function:

static void Lox::Log::info ( const std::string &  msg)
inlinestatic

Info. Can be used to facilitate debugging. There may be many of these generated.

References kInfo, and log().

Here is the call graph for this function:

void Lox::Log::info ( const char *  format,
  ... 
)
static
static void Lox::Log::info ( const Lox::Exception e)
inlinestatic

References kInfo, and log().

Here is the call graph for this function:

void Lox::Log::log ( const EPriority  priority,
const std::string &  msg 
)
static

Log the specified message at the given priority.

Todo:

Referenced by alert(), crit(), critical(), debug(), emerg(), emergency(), err(), error(), info(), log(), notice(), warn(), and warning().

Here is the caller graph for this function:

void Lox::Log::log ( const EPriority  priority,
const char *  format,
  ... 
)
static

Log a message using the usual printf-style formatting.

References log().

Here is the call graph for this function:

void Lox::Log::log ( const EPriority  priority,
const char *  format,
va_list  ap 
)
static

Intended mostly for internal use. See the other variadic logging methods instead.

Todo:
static void Lox::Log::log ( const EPriority  priority,
const Lox::Exception e 
)
inlinestatic

References log().

Referenced by log().

Here is the call graph for this function:

Here is the caller graph for this function:

static void Lox::Log::notice ( const std::string &  msg)
inlinestatic

Notice. Normal log message. Everything seems to be working correctly.

References kNotice, and log().

Here is the call graph for this function:

void Lox::Log::notice ( const char *  format,
  ... 
)
static
static void Lox::Log::notice ( const Lox::Exception e)
inlinestatic

References kNotice, and log().

Here is the call graph for this function:

static void Lox::Log::warn ( const std::string &  msg)
inlinestatic

Warn. Same as warning(). Indicates a minor issue which may need to be brought to the user's attention.

References kWarn, and log().

Here is the call graph for this function:

void Lox::Log::warn ( const char *  format,
  ... 
)
static
static void Lox::Log::warning ( const std::string &  msg)
inlinestatic

Warning. Same as warn(). Indicates a minor issue which may need to be brought to the user's attention.

References kWarning, and log().

Here is the call graph for this function:

void Lox::Log::warning ( const char *  format,
  ... 
)
static
static void Lox::Log::warning ( const Lox::Exception e)
inlinestatic

References kWarning, and log().

Here is the call graph for this function:

Member Data Documentation

std::string Lox::Log::ident
protected

Referenced by Log().


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