SNMP++
3.3.11
|
The LogEntry class represents log entries. More...
#include <log.h>
Public Member Functions | |
LogEntry (const char *const n, unsigned char t) | |
Constructor with log class and severity level. More... | |
virtual | ~LogEntry () |
Virtual destructor. More... | |
virtual void | init () |
Initialize a new log entry, showing timestamp, class, and level. More... | |
virtual LogEntry & | operator+= (const long l) |
Add a numeric value to the log entry. More... | |
virtual LogEntry & | operator+= (const char *s) |
Add a string value to the log entry. More... | |
virtual const char * | get_value () const |
Get the contents of this log entry. More... | |
unsigned char | get_type () const |
Get the type of this log entry. More... | |
unsigned char | get_class () const |
Get the class of this log entry. More... | |
unsigned char | get_level () const |
Get the level of this log entry. More... | |
const char * | get_name () const |
Get the logger name of this log entry. More... | |
Protected Member Functions | |
virtual bool | add_string (const char *s)=0 |
Add a string to the log. More... | |
virtual bool | add_integer (long s) |
Add an integer to the log. More... | |
virtual bool | add_timestamp () |
Add the current time to the log. More... | |
Protected Attributes | |
const char *const | name |
unsigned char | type |
int | count |
The LogEntry class represents log entries.
An instance of LogEntry can be added to a Log. Each LogEntry can be classified into the log classes ERROR_LOG, WARNING_LOG, EVENT_LOG, INFO_LOG, DEBUG_LOG and USER_LOG with up to 16 severity levels. A log entry consists of a descriptor string and optional several string or numeric values.
The log class USER_LOG can be used for applications, it is not used within snmp++ and agent++.
|
inline |
Constructor with log class and severity level.
n | - The name of the logging module |
t | - The type of the log entry. The type is composed by a logical OR of the log entry class with a level of 0 up to 15. |
|
inlinevirtual |
|
protectedvirtual |
Add an integer to the log.
s | - An integer value. |
|
protectedpure virtual |
Add a string to the log.
s | - A string value. |
Implemented in LogEntryImpl.
|
protectedvirtual |
Add the current time to the log.
|
inline |
Get the class of this log entry.
Definition at line 169 of file log.h.
References LOG_CLASS_MASK.
|
inline |
Get the level of this log entry.
Definition at line 176 of file log.h.
References LOG_LEVEL_MASK.
|
inline |
|
inline |
|
inlinevirtual |
Get the contents of this log entry.
Reimplemented in LogEntryImpl.
|
virtual |
Initialize a new log entry, showing timestamp, class, and level.
|
virtual |
Add a numeric value to the log entry.
l | - A numeric value. |
|
virtual |
Add a string value to the log entry.
s | - A string value. |