Platform log service.
More...
#include <logservice.h>
|
| ~LogService () |
|
void | log (LogLevel level, const char *format,...) __attribute__((format(printf |
|
void void | vlog (LogLevel level, const char *format, va_list ap) |
|
void | log (LogLevel level, const Strings &strings) |
|
void | setLogLevel (LogLevel level) |
|
void | redirectLogsToFile (const std::string &file) |
|
void | open () |
|
template<typename Function > |
void | logfn (LogLevel level, Function fn) |
|
template<typename Function > |
void | logfn (LogLevel level, Function fn, const char *fmt, va_list ap) |
|
template<typename Function > |
void | logfn (LogLevel level, Function fn, const char *fmt,...) __attribute__((format(printf |
|
Platform log service.
Handles all logging tasks at the platform level
Definition at line 60 of file logservice.h.
◆ anonymous enum
◆ ~LogService()
EMANE::LogService::~LogService |
( |
| ) |
|
◆ LogService()
EMANE::LogService::LogService |
( |
| ) |
|
|
protected |
◆ destroy()
Destroys the single instance of type T. Once destroyed it cannot be used or recreated. This is not a thread-safe method.
Definition at line 67 of file singleton.h.
◆ instance()
Provides thread-safe access to a single instance of type T. It does not provide thread-safety for T methods.
- Returns
- A pointer to T
Definition at line 56 of file singleton.h.
◆ log() [1/2]
void EMANE::LogService::log |
( |
LogLevel |
level, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
virtual |
Output a log message
- Parameters
-
level | Log level of the message |
fmt | format string (see printf) |
... | Variable data (see printf) |
Reimplemented from EMANE::LogServiceProvider.
Definition at line 117 of file logservice.cc.
◆ log() [2/2]
◆ logfn() [1/3]
template<typename Function >
void EMANE::LogServiceProvider::logfn |
( |
LogLevel |
level, |
|
|
Function |
fn |
|
) |
| |
|
inherited |
Output a log message using a callable
- Parameters
-
level | Log level of the message |
fn | Callable returning Strings |
Definition at line 36 of file logserviceprovider.inl.
◆ logfn() [2/3]
template<typename Function >
void EMANE::LogServiceProvider::logfn |
( |
LogLevel |
level, |
|
|
Function |
fn, |
|
|
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |
|
inherited |
Output a log message using a callable
- Parameters
-
level | Log level of the message |
fn | Callable returning Strings |
fmt | format string (see printf) |
ap | Variable argument list data (see vprintf) |
Definition at line 46 of file logserviceprovider.inl.
◆ logfn() [3/3]
template<typename Function >
void EMANE::LogServiceProvider::logfn |
( |
LogLevel |
level, |
|
|
Function |
fn, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
inherited |
Output a log message using a callable
- Parameters
-
level | Log level of the message |
fn | Callable returning Strings |
fmt | format string (see printf) |
Definition at line 64 of file logserviceprovider.inl.
◆ open()
void EMANE::LogService::open |
( |
| ) |
|
◆ redirectLogsToFile()
void EMANE::LogService::redirectLogsToFile |
( |
const std::string & |
file | ) |
|
◆ setLogLevel()
void EMANE::LogService::setLogLevel |
( |
LogLevel |
level | ) |
|
◆ vlog()
void EMANE::LogService::vlog |
( |
LogLevel |
level, |
|
|
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |
|
virtual |
Output a log message
- Parameters
-
level | Log level of the message |
fmt | format string (see printf) |
ap | Variable argument list data (see vprintf) |
Implements EMANE::LogServiceProvider.
Definition at line 141 of file logservice.cc.
The documentation for this class was generated from the following files: