libutil++  1.9.3
 All Classes Functions Variables
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
sella::util::Log Class Reference

Public Types

typedef std::shared_ptr< Logshared
 
typedef Logptr
 
typedef std::unordered_set
< std::string > 
option_set
 

Public Member Functions

 Log (const std::string &identifier, int facility, int option=DefaultOption, int mask=DefaultLogMask, const LogFormat &format=SimpleLogFormat(), size_t size=DefaultLogSize) throw (LogException)
 
 Log (const std::string &file, const LogFormat &format=SimpleLogFormat(), size_t size=DefaultLogSize) throw (LogException)
 
 Log (const Log &other) throw ()
 
Logoperator= (const Log &other) throw ()
 
void setIdentifier (const std::string &identifier=std::string()) throw ()
 
void setFacility (int facility) throw ()
 
void setOption (int option=DefaultOption) throw ()
 
void setFormat (const LogFormat &format) throw ()
 
void setLogLevel (int level, bool on=true) throw ()
 
int setLogMask (int mask) throw ()
 
void setLogSize (size_t size=DefaultLogSize) throw ()
 
int getLogMask (void) throw ()
 
bool isLogMask (int level) throw ()
 
size_t getLogSize (void) throw ()
 
void setTraceOption (const std::string &option, bool on=true) throw ()
 
void setTraceOption (const std::vector< std::string > &options, bool on=true) throw ()
 
void setTraceOption (const std::list< std::string > &options, bool on=true) throw ()
 
void setTraceOptions (const std::vector< std::string > &options, bool on=true) throw ()
 
void setTraceOptions (const std::list< std::string > &options, bool on=true) throw ()
 
bool isTraceOption (const char *option) throw ()
 
bool isTraceOption (const std::string &option) throw ()
 
bool isTraceOption (const std::vector< std::string > &options) throw ()
 
bool isTraceOption (const std::list< std::string > &options) throw ()
 
bool hasTraceOptions (void) throw ()
 
void clearTraceOptions (void) throw ()
 
bool isTime (time_t &next, int sec) throw ()
 
bool incEveryN (uint64_t n) throw ()
 
bool incFirstN (uint64_t n) throw ()
 
void resetEveryN (void) throw ()
 
bool trace (const char *option, const char *func, const char *file, int line, const char *format,...) throw ()
 
bool trace (std::string &option, const char *func, const char *file, int line, const char *format,...) throw ()
 
bool trace (const char *option, const char *func, const char *file, int line, const std::string &format,...) throw ()
 
bool trace (std::string &option, const char *func, const char *file, int line, const std::string &format,...) throw ()
 
bool trace (const std::vector< std::string > &options, const char *func, const char *file, int line, const char *format,...) throw ()
 
bool trace (const std::vector< std::string > &options, const char *func, const char *file, int line, const std::string &format,...) throw ()
 
bool trace (const std::list< std::string > &options, const char *func, const char *file, int line, const char *format,...) throw ()
 
bool trace (const std::list< std::string > &options, const char *func, const char *file, int line, const std::string &format,...) throw ()
 
bool write (int facility, int level, const char *func, const char *file, int line, const sella::Exception &e, const std::string &format,...) throw ()
 
bool write (int facility, int level, const char *func, const char *file, int line, const std::string &format,...) throw ()
 
bool write (int level, const char *func, const char *file, int line, const sella::Exception &e) throw ()
 
bool write (int level, const char *func, const char *file, int line, const sella::Exception &e, const std::string &format,...) throw ()
 
bool write (int level, const char *func, const char *file, int line, const std::string &format,...) throw ()
 
bool write (int facility, int level, const char *func, const char *file, int line, const sella::Exception &e, const char *format,...) throw ()
 
bool write (int facility, int level, const char *func, const char *file, int line, const char *format,...) throw ()
 
bool write (int level, const char *func, const char *file, int line, const sella::Exception &e, const char *format,...) throw ()
 
bool write (int level, const char *func, const char *file, int line, const char *format,...) throw ()
 

Static Public Member Functions

static Log::shared & instance (const std::string &identifier=std::string())
 
static const Log::shared shared_ptr (const std::string &identifier, int facility, int option=DefaultOption, int mask=DefaultLogMask, const LogFormat &format=SimpleLogFormat(), size_t size=DefaultLogSize) throw (LogException)
 
static const Log::shared shared_ptr (const std::string &file, const LogFormat &format=SimpleLogFormat(), size_t size=DefaultLogSize) throw (LogException)
 
static const char * priority (int level) throw ()
 

Static Public Attributes

static const int FACILITY_AUTH = LOG_AUTH
 
static const int FACILITY_AUTHPRIV = LOG_AUTHPRIV
 
static const int FACILITY_CRON = LOG_CRON
 
static const int FACILITY_DAEMON = LOG_DAEMON
 
static const int FACILITY_FTP = LOG_FTP
 
static const int FACILITY_KERN = LOG_KERN
 
static const int FACILITY_LOCAL0 = LOG_LOCAL0
 
static const int FACILITY_LOCAL1 = LOG_LOCAL1
 
static const int FACILITY_LOCAL2 = LOG_LOCAL2
 
static const int FACILITY_LOCAL3 = LOG_LOCAL3
 
static const int FACILITY_LOCAL4 = LOG_LOCAL4
 
static const int FACILITY_LOCAL5 = LOG_LOCAL5
 
static const int FACILITY_LOCAL6 = LOG_LOCAL6
 
static const int FACILITY_LOCAL7 = LOG_LOCAL7
 
static const int FACILITY_LPR = LOG_LPR
 
static const int FACILITY_MAIL = LOG_MAIL
 
static const int FACILITY_NEWS = LOG_NEWS
 
static const int FACILITY_SYSLOG = LOG_SYSLOG
 
static const int FACILITY_USER = LOG_USER
 
static const int FACILITY_UUCP = LOG_UUCP
 
static const int LEVEL_EMERGENCY = LOG_EMERG
 
static const int LEVEL_ALERT = LOG_ALERT
 
static const int LEVEL_CRITICAL = LOG_CRIT
 
static const int LEVEL_ERROR = LOG_ERR
 
static const int LEVEL_WARNING = LOG_WARNING
 
static const int LEVEL_NOTICE = LOG_NOTICE
 
static const int LEVEL_INFO = LOG_INFO
 
static const int LEVEL_DEBUG = LOG_DEBUG
 
static const char * LABEL_EMERGENCY = "EMRG"
 
static const char * LABEL_ALERT = "ALRT"
 
static const char * LABEL_CRITICAL = "CRIT"
 
static const char * LABEL_ERROR = "ERRO"
 
static const char * LABEL_WARNING = "WARN"
 
static const char * LABEL_NOTICE = "NOTE"
 
static const char * LABEL_INFO = "INFO"
 
static const char * LABEL_DEBUG = "DEBG"
 
static const int DefaultOption = (LOG_CONS|LOG_NDELAY|LOG_NOWAIT|LOG_PID)
 
static const int WithStderrOption = (LOG_CONS|LOG_NDELAY|LOG_NOWAIT|LOG_PID|LOG_PERROR)
 
static const int DefaultLogMask = LOG_UPTO(LOG_DEBUG)
 
static const size_t DefaultLogSize = 1022
 

Detailed Description

Definition at line 202 of file Log.h.


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