|
libqi
1.12
|
Log functions. More...
Classes | |
| class | ConsoleLogHandler |
| Print colored logs to the consoleColor will be enable only when the output is a tty. More... | |
| class | FileLogHandler |
| log to file handler More... | |
| class | HeadFileLogHandler |
| Log the length first lines to file. More... | |
| class | LogStream |
| Each log macro create a LogStream object. More... | |
Typedefs | |
|
typedef boost::function7< void, const qi::log::LogLevel, const qi::os::timeval, const char *, const char *, const char *, const char *, int > | logFuncHandler |
| Boost delegate to log function (verbosity lv, date of log, category, message, file, function, line). e.g. | |
Enumerations | |
| enum | LogLevel { silent = 0, fatal, error, warning, info, verbose, debug } |
| Log level verbosity. More... | |
Functions | |
| QI_API void | init (qi::log::LogLevel verb=qi::log::info, int ctx=0, bool synchronous=true) |
| init the logging system (could be avoided) | |
| QI_API void | destroy () |
| stop and flush the logging systemshould be called in the main of program using atexit. for example: atexit(qi::log::destroy) This is useful only for asynchronous log. | |
| QI_API void | log (const qi::log::LogLevel verb, const char *category, const char *msg, const char *file="", const char *fct="", const int line=0) |
| Log functionYou should call qiLog* macro. | |
| QI_API const char * | logLevelToString (const qi::log::LogLevel verb) |
| Convert log verbosity to char*. | |
| QI_API const qi::log::LogLevel | stringToLogLevel (const char *verb) |
| Convert string to log verbosity. | |
| QI_API void | setVerbosity (const qi::log::LogLevel lv) |
| Set log verbosity.If you don't want any log use silent mode. | |
| QI_API qi::log::LogLevel | verbosity () |
| Get log verbosity. | |
| QI_API void | setContext (int ctx) |
| Set log context.Display log context (line, function, file). | |
| QI_API int | context () |
| Get log context. | |
| QI_API void | setSynchronousLog (bool sync) |
| Set synchronous logs. | |
| QI_API void | addLogHandler (const std::string &name, qi::log::logFuncHandler fct) |
| Add log handler. | |
| QI_API void | removeLogHandler (const std::string &name) |
| remove log handler. | |
| QI_API void | flush () |
| flush asynchronous log. | |
Log functions.