Logger Class Reference
#include <logger.h>
List of all members.
Detailed Description
A Logger class
Member Typedef Documentation
typedef for a bitmask (long long)
typedef for a component name (std:string)
Member Enumeration Documentation
Use the same values for log levels as syslog
- Enumerator:
Lvl0 |
|
Lvl1 |
|
Lvl2 |
|
Lvl3 |
|
Lvl4 |
|
Lvl5 |
|
Constructor & Destructor Documentation
Logger::Logger |
( |
|
) |
[private] |
Logger::Logger |
( |
Logger const & |
|
) |
[private] |
Member Function Documentation
static Logger* Logger::get |
( |
|
) |
[inline, static] |
- Returns:
- the singleton instance
short Logger::getLevel |
( |
|
) |
const [inline] |
- Returns:
- the current debug level
- Parameters:
-
- Returns:
- respectiv bitmask assigned to given component
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
bool Logger::isLogged |
( |
bitmask |
m |
) |
const [inline] |
- Returns:
- true if the given component is being logged, false otherwise
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 |
void Logger::logAll |
( |
|
) |
[inline] |
- Parameters:
-
| if | true all unregistered components will be logged, if false only registered components will be logged |
void Logger::registerComponent |
( |
component const & |
comp |
) |
|
- Parameters:
-
| comp | : the component that will be registered for logging |
void Logger::registerComponents |
( |
std::vector< component > const & |
components |
) |
|
- Parameters:
-
| components | : list of components that will be registered for logging |
static void Logger::set |
( |
Logger * |
inst |
) |
[inline, static] |
void Logger::setLevel |
( |
Level |
lvl |
) |
[inline] |
- Parameters:
-
| lvl | : the logging level that will be set |
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 |
Member Data Documentation
component name to bitmask mapping
global bitmask with all registered components
number of components that were assigned with a bitmask
The documentation for this class was generated from the following file: