SNMP++  3.3.4
log.h File Reference
#include <snmp_pp/config_snmp_pp.h>
#include <snmp_pp/reentrant.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Classes

class  LogEntry
 The LogEntry class represents log entries. More...
 
class  LogEntryImpl
 The LogEntryImpl class implements a log entry using a dynamically allocated, but fixed-size buffer. More...
 
class  AgentLog
 The AgentLog class is an abstract base class representing a log for information that is generated during the run time of an AGENT++ SNMP agent. More...
 
class  AgentLogImpl
 The AgentLogImpl class is an implementation of AgentLog which writes log messages to a file, or to stdout or stderr. More...
 
class  DefaultLog
 The DefaultLog class has a static Log member, that is used by the AGENT++ API for logging. More...
 

Macros

#define ERROR_LOG   0x10
 
#define WARNING_LOG   0x20
 
#define EVENT_LOG   0x30
 
#define INFO_LOG   0x40
 
#define DEBUG_LOG   0x50
 
#define USER_LOG   0x60
 
#define LOG_CLASS_MASK   0xF0
 
#define LOG_LEVEL_MASK   0x0F
 
#define LOG_TYPES   6
 
#define LOG_BEGIN(name, level)
 
#define LOG(item)   *DefaultLog::log_entry() += item
 
#define LOG_END
 
#define LOG_UNUSED(x)   x
 
#define MAX_LOG_SIZE   2550
 

Macro Definition Documentation

#define DEBUG_LOG   0x50

Definition at line 50 of file log.h.

#define ERROR_LOG   0x10

Definition at line 46 of file log.h.

Referenced by DefaultLog::log_entry().

#define EVENT_LOG   0x30

Definition at line 48 of file log.h.

#define INFO_LOG   0x40

Definition at line 49 of file log.h.

#define LOG (   item)    *DefaultLog::log_entry() += item

Definition at line 75 of file log.h.

#define LOG_BEGIN (   name,
  level 
)
Value:
{ \
if (DefaultLog::log()->log_needed(name,level)) \
{ \
static void create_log_entry(const char *name, unsigned char t)
Create a new log entry or reuse an existing one.
Definition: log.h:548
static void lock()
Lock the log singleton.
Definition: log.h:585
static AgentLog * log()
Return the default logger.
Definition: log.h:534

Definition at line 68 of file log.h.

#define LOG_CLASS_MASK   0xF0

Definition at line 53 of file log.h.

Referenced by LogEntry::get_class().

#define LOG_END
Value:
} \
} \
(void)0
static void unlock()
Unlock the log singleton.
Definition: log.h:595
static AgentLog * log()
Return the default logger.
Definition: log.h:534
static void delete_log_entry()
Delete current log entry.
Definition: log.h:575
static LogEntry * log_entry()
Return the current log entry.
Definition: log.h:564

Definition at line 77 of file log.h.

#define LOG_LEVEL_MASK   0x0F

Definition at line 54 of file log.h.

Referenced by LogEntry::get_level(), and AgentLog::log_needed().

#define LOG_TYPES   6

Definition at line 56 of file log.h.

#define LOG_UNUSED (   x)    x

Definition at line 85 of file log.h.

#define MAX_LOG_SIZE   2550

Definition at line 217 of file log.h.

Referenced by LogEntryImpl::bytes_left(), and LogEntryImpl::LogEntryImpl().

#define USER_LOG   0x60

Definition at line 51 of file log.h.

#define WARNING_LOG   0x20

Definition at line 47 of file log.h.