SNMP++  3.3.11
LogEntryImpl Class Reference

The LogEntryImpl class implements a log entry using a dynamically allocated, but fixed-size buffer. More...

#include <log.h>

Inheritance diagram for LogEntryImpl:
Collaboration diagram for LogEntryImpl:

Public Member Functions

 LogEntryImpl (const char *const n, unsigned char t)
 Constructor with log class and severity level. More...
 
virtual ~LogEntryImpl ()
 Destructor. More...
 
virtual const char * get_value () const
 Get the contents of this log entry. More...
 
- Public Member Functions inherited from LogEntry
 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 LogEntryoperator+= (const long l)
 Add a numeric value to the log entry. More...
 
virtual LogEntryoperator+= (const char *s)
 Add a string value to the 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

unsigned int bytes_left ()
 Count the bytes left for additional values. More...
 
bool add_string (const char *s)
 Add a string to the log. More...
 
- Protected Member Functions inherited from LogEntry
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...
 

Private Attributes

char * value
 
char * ptr
 
bool output_stopped
 

Additional Inherited Members

- Protected Attributes inherited from LogEntry
const char *const name
 
unsigned char type
 
int count
 

Detailed Description

The LogEntryImpl class implements a log entry using a dynamically allocated, but fixed-size buffer.

See also
Log
Author
Marty Janzen
Version
3.6

Definition at line 229 of file log.h.

Constructor & Destructor Documentation

◆ LogEntryImpl()

LogEntryImpl::LogEntryImpl ( const char *const  n,
unsigned char  t 
)
inline

Constructor with log class and severity level.

Parameters
n- The name of the logging module
t- The type of the log entry. The type is composed by logical or the log entry class with a level of 0 up to 15.
Note
A error log of level 0 will stop program execution!

Definition at line 240 of file log.h.

References MAX_LOG_SIZE.

◆ ~LogEntryImpl()

virtual LogEntryImpl::~LogEntryImpl ( )
inlinevirtual

Destructor.

Definition at line 252 of file log.h.

Member Function Documentation

◆ add_string()

bool LogEntryImpl::add_string ( const char *  s)
protectedvirtual

Add a string to the log.

Parameters
s- A string value.
Returns
TRUE if the value has been added and FALSE if the log entry is full.

Implements LogEntry.

◆ bytes_left()

unsigned int LogEntryImpl::bytes_left ( )
inlineprotected

Count the bytes left for additional values.

Returns
The number of bytes left in this log entry.

Definition at line 270 of file log.h.

References MAX_LOG_SIZE.

◆ get_value()

virtual const char* LogEntryImpl::get_value ( ) const
inlinevirtual

Get the contents of this log entry.

Returns
Current contents of this log entry.

Reimplemented from LogEntry.

Definition at line 262 of file log.h.

Member Data Documentation

◆ output_stopped

bool LogEntryImpl::output_stopped
private

Definition at line 285 of file log.h.

◆ ptr

char* LogEntryImpl::ptr
private

Definition at line 284 of file log.h.

◆ value

char* LogEntryImpl::value
private

Definition at line 283 of file log.h.


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