Typedefs | |
using | callbackLog = std::function< void(const char *_libName, enum elog::level _level, int32_t _ligne, const char *_funcName, const char *_log)> |
Enumerations | |
enum | level { level_print = -1, level_none = 0, level_critical = 1, level_error = 2, level_warning = 3, level_info = 4, level_debug = 5, level_verbose = 6 } |
Functions | |
void | init (int _argc, const char **_argv) |
int32_t | registerInstance (const std::string &_name) |
void | setLevel (const std::string &_name, enum elog::level _level) |
void | setLevel (int32_t _id, enum elog::level _level) |
void | setLevel (enum elog::level _level) |
int32_t | getLevel (int32_t _id) |
std::vector< std::string > | getListInstance () |
void | setColor (bool _status) |
void | setTime (bool _status) |
void | setLine (bool _status) |
void | setFunction (bool _status) |
void | setThreadId (bool _status) |
void | setThreadNameEnable (bool _status) |
void | setLibName (bool _status) |
void | setBackTrace (bool _status) |
void | logChar (int32_t _id, int32_t _level, int32_t _ligne, const char *_funcName, const char *_log) |
void | logStream (int32_t _id, int32_t _level, int32_t _ligne, const char *_funcName, const std::ostream &_log) |
void | logChar1 (int32_t _id, int32_t _level, const char *_log) |
void | logStream1 (int32_t _id, int32_t _level, const std::ostream &_log) |
void | displayBacktrace (bool _breakAtEnd=false, int32_t _removeElement=0) |
void | setCallbackLog (const elog::callbackLog &_callback) |
void | setLogInFile (const std::string &_filename="") |
void | unsetLogInFile () |
Detailed Description
basic namespace of the elog library. (it might contain all the elog fuctions without macro)
Typedef Documentation
§ callbackLog
using elog::callbackLog = typedef std::function<void (const char* _libName, enum elog::level _level, int32_t _ligne, const char* _funcName, const char* _log)> |
function definition of an external log function
- Parameters
-
[in] _libName pounter on a string containing the library name [in] _level Level of the log (can be filter with setLevel) [in] _ligne Line of the log [in] _funcName Full function name: 'void etk::MyClass::functionName(...)' [in] _log String containing the Log
Enumeration Type Documentation
§ level
enum elog::level |
Log level is a simple list of all log availlable. This enum is used when setting a log and when user chose the level of log displayed.
- Note
- : I use a "enum" and not an "enum class" because it create some problem on the macro declaration (not easy to convert number in an "enum class"
Function Documentation
§ displayBacktrace()
void elog::displayBacktrace | ( | bool | _breakAtEnd = false , |
int32_t | _removeElement = 0 |
||
) |
Display the current backtrace.
- Parameters
-
[in] _breakAtEnd assert program when backtrace is printed [in] _removeElement Number of element remove in the stack before display (permit to remove log function call)
§ getLevel()
int32_t elog::getLevel | ( | int32_t | _id | ) |
Get the current level of debug for a specific intance.
- Parameters
-
[in] _id Id Of the intance
- Returns
- the enum casted in an integer ==> generise the API (not dependent of etk)
§ getListInstance()
std::vector<std::string> elog::getListInstance | ( | ) |
Get list of all intance.
- Returns
- the name list of all intance
§ init()
void elog::init | ( | int | _argc, |
const char ** | _argv | ||
) |
Initialize elog.
- Parameters
-
[in] _argc Number of argument list [in] _argv List of arguments
§ logChar()
void elog::logChar | ( | int32_t | _id, |
int32_t | _level, | ||
int32_t | _ligne, | ||
const char * | _funcName, | ||
const char * | _log | ||
) |
Call log to display.
- Parameters
-
[in] _id Id of the instance type [in] _level Level debug [in] _ligne Line of the debug [in] _funcName Function name for debug (compleate decorate signature) [in] _log Stream to log
§ logChar1()
void elog::logChar1 | ( | int32_t | _id, |
int32_t | _level, | ||
const char * | _log | ||
) |
Call log to display.
- Parameters
-
[in] _id Id of the instance type [in] _level Level debug [in] _log Stream to log
§ logStream()
void elog::logStream | ( | int32_t | _id, |
int32_t | _level, | ||
int32_t | _ligne, | ||
const char * | _funcName, | ||
const std::ostream & | _log | ||
) |
Call log to display.
- Parameters
-
[in] _id Id of the instance type [in] _level Level debug [in] _ligne Line of the debug [in] _funcName Function name for debug (compleate decorate signature) [in] _log Stream to log
§ logStream1()
void elog::logStream1 | ( | int32_t | _id, |
int32_t | _level, | ||
const std::ostream & | _log | ||
) |
Call log to display.
- Parameters
-
[in] _id Id of the instance type [in] _level Level debug [in] _log Stream to log
§ registerInstance()
int32_t elog::registerInstance | ( | const std::string & | _name | ) |
Register an element in the log system.
- Parameters
-
[in] _name Name of the module
- Returns
- reference Id of an instance name
§ setBackTrace()
void elog::setBackTrace | ( | bool | _status | ) |
Set back-trace display on Error log enable or disable.
- Parameters
-
[in] _status New value.
§ setCallbackLog()
void elog::setCallbackLog | ( | const elog::callbackLog & | _callback | ) |
Set a callback to display all log in an other framework.
- Parameters
-
[in] _callback Function to call when log arrive
§ setColor()
void elog::setColor | ( | bool | _status | ) |
Set Color enable or disable.
- Parameters
-
[in] _status New value of color.
§ setFunction()
void elog::setFunction | ( | bool | _status | ) |
Set Function display enable or disable.
- Parameters
-
[in] _status New value.
§ setLevel() [1/3]
void elog::setLevel | ( | const std::string & | _name, |
enum elog::level | _level | ||
) |
Set the log level of a specific instance.
- Parameters
-
[in] _name Name of the intance [in] _level New level to set on the instance
§ setLevel() [2/3]
void elog::setLevel | ( | int32_t | _id, |
enum elog::level | _level | ||
) |
Set the log level of a specific instance.
- Parameters
-
[in] _id Id of the intance [in] _level New level to set on the instance
§ setLevel() [3/3]
void elog::setLevel | ( | enum elog::level | _level | ) |
Set global debug level.
- Parameters
-
[in] _level New level to set on the instance
§ setLibName()
void elog::setLibName | ( | bool | _status | ) |
Set library display enable or disable.
- Parameters
-
[in] _status New value.
§ setLine()
void elog::setLine | ( | bool | _status | ) |
Set Line display enable or disable.
- Parameters
-
[in] _status New value.
§ setLogInFile()
void elog::setLogInFile | ( | const std::string & | _filename = "" | ) |
Set log done in a specific file.
- Parameters
-
[in] _filename Name of the file to log (if not set the log system select alone the log file)
- Note
- in release the log is automatically store in a file in the system. (windows log is done in file automatically)
§ setThreadId()
void elog::setThreadId | ( | bool | _status | ) |
Set thread id enable or disable.
- Parameters
-
[in] _status New value.
§ setThreadNameEnable()
void elog::setThreadNameEnable | ( | bool | _status | ) |
Set thread name enable or disable.
- Parameters
-
[in] _status New value.
§ setTime()
void elog::setTime | ( | bool | _status | ) |
Set Time display enable or disable.
- Parameters
-
[in] _status New value.
§ unsetLogInFile()
void elog::unsetLogInFile | ( | ) |
Disable log in a file.