#include <logger.h>
◆ bitmask
typedef for a bitmask (long long)
◆ component
typedef for a component name (std:string)
◆ Level
Use the same values for log levels as syslog
Enumerator |
---|
Lvl0 | |
Lvl1 | |
Lvl2 | |
Lvl3 | |
Lvl4 | |
Lvl5 | |
◆ ~Logger()
◆ Logger() [1/2]
◆ Logger() [2/2]
Logger::Logger |
( |
Logger const & |
| ) |
|
|
private |
◆ get()
static Logger* Logger::get |
( |
| ) |
|
|
inlinestatic |
- Returns
- the singleton instance
◆ getLevel()
short Logger::getLevel |
( |
| ) |
const |
|
inline |
- Returns
- the current debug level
◆ getMask()
- Parameters
-
- Returns
- respectiv bitmask assigned to given component
◆ getStackTrace()
static int Logger::getStackTrace |
( |
std::string & |
s | ) |
|
|
static |
Build a printable stacktrace. Useful e.g. inside exceptions, to understand where they come from. Note: I don't think that the backtrace() function is thread safe, nor this function Returns the number of backtraces
- Parameters
-
s | : the string that will contain the printable stacktrace |
- Returns
- the number of stacktraces
◆ isLogged()
bool Logger::isLogged |
( |
bitmask |
m | ) |
const |
|
inline |
- Returns
- true if the given component is being logged, false otherwise
◆ log()
void Logger::log |
( |
Level |
lvl, |
|
|
std::string const & |
msg |
|
) |
| const |
Logs the message
- Parameters
-
lvl | : log level of the message |
component | : bitmask assignet to the given component |
msg | : the message to be logged |
◆ logAll()
- Parameters
-
if | true all unregistered components will be logged, if false only registered components will be logged |
◆ operator=()
◆ registerComponent()
void Logger::registerComponent |
( |
component const & |
comp | ) |
|
- Parameters
-
comp | : the component that will be registered for logging |
◆ registerComponents()
void Logger::registerComponents |
( |
std::vector< component > const & |
components | ) |
|
- Parameters
-
components | : list of components that will be registered for logging |
◆ set()
static void Logger::set |
( |
Logger * |
inst | ) |
|
|
inlinestatic |
◆ setLevel()
void Logger::setLevel |
( |
Level |
lvl | ) |
|
|
inline |
- Parameters
-
lvl | : the logging level that will be set |
◆ setLogged()
void Logger::setLogged |
( |
component const & |
comp, |
|
|
bool |
tobelogged |
|
) |
| |
Sets if a component has to be logged or not
- Parameters
-
comp | : the component name |
tobelogged | : true if we want to log this component |
◆ instance
◆ level
◆ mapping
component name to bitmask mapping
◆ mask
global bitmask with all registered components
◆ size
number of components that were assigned with a bitmask
◆ unregistered
◆ unregisteredname
char* Logger::unregisteredname |
|
static |
The documentation for this class was generated from the following file: