log.hpp File Reference
#include <sstream>
#include <ostream>
#include <vector>
#include <functional>
Go to the source code of this file.
Namespaces | |
elog | |
Macros | |
#define | ELOG_BASE(logId, info, data) |
Typedefs | |
using | elog::callbackLog = std::function< void(const char *_libName, enum elog::level _level, int32_t _ligne, const char *_funcName, const char *_log)> |
Enumerations | |
enum | elog::level { elog::level_print = -1, elog::level_none = 0, elog::level_critical = 1, elog::level_error = 2, elog::level_warning = 3, elog::level_info = 4, elog::level_debug = 5, elog::level_verbose = 6 } |
Functions | |
int32_t | elog::registerInstance (const std::string &_name) |
void | elog::setLevel (const std::string &_name, enum elog::level _level) |
void | elog::setLevel (int32_t _id, enum elog::level _level) |
void | elog::setLevel (enum elog::level _level) |
int32_t | elog::getLevel (int32_t _id) |
std::vector< std::string > | elog::getListInstance () |
void | elog::setColor (bool _status) |
void | elog::setTime (bool _status) |
void | elog::setLine (bool _status) |
void | elog::setFunction (bool _status) |
void | elog::setThreadId (bool _status) |
void | elog::setThreadNameEnable (bool _status) |
void | elog::setLibName (bool _status) |
void | elog::setBackTrace (bool _status) |
void | elog::logChar (int32_t _id, int32_t _level, int32_t _ligne, const char *_funcName, const char *_log) |
void | elog::logStream (int32_t _id, int32_t _level, int32_t _ligne, const char *_funcName, const std::ostream &_log) |
void | elog::logChar1 (int32_t _id, int32_t _level, const char *_log) |
void | elog::logStream1 (int32_t _id, int32_t _level, const std::ostream &_log) |
void | elog::displayBacktrace (bool _breakAtEnd=false, int32_t _removeElement=0) |
void | elog::setCallbackLog (const elog::callbackLog &_callback) |
void | elog::setLogInFile (const std::string &_filename="") |
void | elog::unsetLogInFile () |
Detailed Description
- Copyright
- 2011, Edouard DUPIN, all right reserved
- Note
- License: APACHE v2.0 (see license file)
Macro Definition Documentation
§ ELOG_BASE
#define ELOG_BASE | ( | logId, | |
info, | |||
data | |||
) |
Value:
do { \
if (info <= elog::getLevel(logId)) { \
std::stringbuf sb; \
std::ostream tmpStream(&sb); \
tmpStream << data; \
elog::logStream(logId, info, __LINE__, __PRETTY_FUNCTION__, tmpStream); \
} \
} while(0)
void logStream(int32_t _id, int32_t _level, int32_t _ligne, const char *_funcName, const std::ostream &_log)
Call log to display.
Basic macro of all logs macros.
- Parameters
-
[in] logId Id of the library that log [in] info Log level of this log: elog::level [in] data Stream separaated with "<<" convertible in std::ostream