|
base-logging
|
Logger is a logger that allows priority based logging with minimal impact on performance and minimal configuration requirements. More...
#include <logging_printf_style.h>
Public Member Functions | |
| virtual | ~Logger () |
| void | configure (Priority priority, FILE *outputStream) |
| void | log (Priority priority, const char *function, const char *filename, int line, const char *name_space, const char *format,...) const |
| void | logBuffer (Priority priority, const char *function, const char *file, int line, const char *name_space, const char *buffer) const |
Public Member Functions inherited from base::Singleton< Derived > | |
| virtual | ~Singleton () |
Protected Member Functions | |
| Logger () | |
Protected Member Functions inherited from base::Singleton< Derived > | |
| Singleton () | |
Friends | |
| class | Singleton< Logger > |
Additional Inherited Members | |
Static Public Member Functions inherited from base::Singleton< Derived > | |
| static Derived * | getInstance () |
Logger is a logger that allows priority based logging with minimal impact on performance and minimal configuration requirements.
Use the environment variable BASE_LOG_LEVEL to define the requested logging level, e.g.:
A library designer can decide using the BASE_LOG_xxx flag at compile time which log level should be available.
So switch the output stream (for example logging into a file) the following can be used:
BASE_LOG_CONFIGURE(priority,ostream)
|
protected |
Construct the logger
|
virtual |
| void base::logging::Logger::configure | ( | Priority | priority, |
| FILE * | outputStream | ||
| ) |
Configure logger - this is for the library developer so he can set a maximum log level, which cannot be further limited to higher log priorities via setting BASE_LOG_LEVEL.
If no previous configuration is given, no output logging will be done
| void base::logging::Logger::log | ( | Priority | priority, |
| const char * | function, | ||
| const char * | filename, | ||
| int | line, | ||
| const char * | name_space, | ||
| const char * | format, | ||
| ... | |||
| ) | const |
Logs a message with a given priority, can be used with printf style format
| priority | priority level |
| ns | namespace to be used |
| filename | Filename |
| line | Linenumber |
| format | printf like format string |
| ... | variable argument list |
| void base::logging::Logger::logBuffer | ( | Priority | priority, |
| const char * | function, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | name_space, | ||
| const char * | buffer | ||
| ) | const |
used by log(...) logs the text contained in buffer.
1.8.13