|
Elektra 0.8.26
|
Import the logging library in your code:
Insert logging statements:
If Elektra should display all log messages, then please follow the steps below.
Uncomment the line:
in the file src/libs/elektra/log.c.
Optional: Change the debug level in src/include/kdblogger.h. For example, if you want to see debug messages too, then change the line
to
If you want to only log messages below a specific directory prefix, then please follow the steps below.
Search for the code:
in the file src/libs/elektra/log.c.
Replace the code with something like:
, where src/postfix contains all source files with logging statements that Elektra should log. For example, if you want to log everything from the yamlcpp plugin, then use the following code.
. To log messages from multiple source you can use the operator && to chain multiple calls to strncmp. For example, to log messages from the directoryvalue and yamlcpp plugin use the code:
There are four log levels (ERROR is reserved for aborts within ELEKTRA_ASSERT):