The DefaultLog class has a static Log member, that is used by the AGENT++ API for logging.
More...
#include <log.h>
The DefaultLog class has a static Log member, that is used by the AGENT++ API for logging.
- Version
- 3.6
- Author
- Frank Fock (singleton pattern -> Philippe Roger)
Definition at line 485 of file log.h.
◆ DefaultLog()
DefaultLog::DefaultLog |
( |
| ) |
|
|
inline |
◆ ~DefaultLog()
DefaultLog::~DefaultLog |
( |
| ) |
|
|
inline |
◆ cleanup()
static void DefaultLog::cleanup |
( |
| ) |
|
|
static |
Free the logging implementation.
- Note
- This method is THREADSAFE.
◆ create_log_entry()
static void DefaultLog::create_log_entry |
( |
const char * |
name, |
|
|
unsigned char |
type |
|
) |
| |
|
inlinestatic |
Create a new log entry or reuse an existing one.
- Parameters
-
name | - The name of the logging module |
type | the type of the log entry as bitwise or of log class and level. |
Definition at line 550 of file log.h.
◆ delete_log_entry()
static void DefaultLog::delete_log_entry |
( |
| ) |
|
|
inlinestatic |
Delete current log entry.
Definition at line 577 of file log.h.
◆ init()
static void DefaultLog::init |
( |
AgentLog * |
logger | ) |
|
|
inlinestatic |
Initialize the default logger with the given logging implementation.
- Note
- Call cleanup function before the application exits
-
The DefaultLog class takes ownership of the pointer. Do not delete it yourself.
-
This method is NOT THREADSAFE. It must be called in main() before any logging takes place.
- Parameters
-
logger | an AgentLog instance to be used as default logger. A previously set logger will be deleted. |
Definition at line 503 of file log.h.
◆ init_ts()
Initialize the default logger with the given logging implementation if there is currently no logger instance set.
- Note
- Call cleanup function before the application exits
-
The DefaultLog class takes ownership of the pointer. Do not delete it yourself.
-
This method is THREADSAFE.
- Parameters
-
logger | an AgentLog instance to be used as default logger. |
- Returns
- the existing logger (if there was any) or the new logger pointer.
- Since
- 3.5.24
◆ lock()
static void DefaultLog::lock |
( |
| ) |
|
|
inlinestatic |
Lock the log singleton.
Definition at line 587 of file log.h.
◆ log()
Return the default logger.
- Returns
- a pointer to an AgentLog instance.
Definition at line 535 of file log.h.
◆ log_entry()
static LogEntry* DefaultLog::log_entry |
( |
| ) |
|
|
inlinestatic |
Return the current log entry.
If there is none, an ERROR_LOG entry with level 1 will be created.
- Returns
- a pointer to a LogEntry instance.
Definition at line 566 of file log.h.
References ERROR_LOG.
◆ unlock()
static void DefaultLog::unlock |
( |
| ) |
|
|
inlinestatic |
Unlock the log singleton.
Definition at line 597 of file log.h.
◆ defaultName
const char DefaultLog::defaultName |
|
staticprotected |
◆ entry
◆ instance
◆ mutex
The documentation for this class was generated from the following file: