SNMP++  3.3.11
log.h File Reference
#include <libsnmp.h>
#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

◆ DEBUG_LOG

#define DEBUG_LOG   0x50

Definition at line 51 of file log.h.

◆ ERROR_LOG

#define ERROR_LOG   0x10

Definition at line 47 of file log.h.

Referenced by DefaultLog::log_entry().

◆ EVENT_LOG

#define EVENT_LOG   0x30

Definition at line 49 of file log.h.

◆ INFO_LOG

#define INFO_LOG   0x40

Definition at line 50 of file log.h.

◆ LOG

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

Definition at line 76 of file log.h.

◆ LOG_BEGIN

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

Definition at line 69 of file log.h.

◆ LOG_CLASS_MASK

#define LOG_CLASS_MASK   0xF0

Definition at line 54 of file log.h.

Referenced by LogEntry::get_class().

◆ LOG_END

#define LOG_END
Value:
} \
} \
(void)0
static void unlock()
Unlock the log singleton.
Definition: log.h:597
static AgentLog * log()
Return the default logger.
Definition: log.h:535
static void delete_log_entry()
Delete current log entry.
Definition: log.h:577
static LogEntry * log_entry()
Return the current log entry.
Definition: log.h:566

Definition at line 78 of file log.h.

◆ LOG_LEVEL_MASK

#define LOG_LEVEL_MASK   0x0F

Definition at line 55 of file log.h.

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

◆ LOG_TYPES

#define LOG_TYPES   6

Definition at line 57 of file log.h.

◆ LOG_UNUSED

#define LOG_UNUSED (   x)    x

Definition at line 86 of file log.h.

◆ MAX_LOG_SIZE

#define MAX_LOG_SIZE   2550

Definition at line 218 of file log.h.

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

◆ USER_LOG

#define USER_LOG   0x60

Definition at line 52 of file log.h.

◆ WARNING_LOG

#define WARNING_LOG   0x20

Definition at line 48 of file log.h.