7. Attaching a Module Name to the logs.

If you wish to attach a module name with the logs that appear from a (group of) file(s), the macro LOG_MODULE_NAME should be defined. Note: The order of definition of macro LOG_MODULE_NAME is very important, it should be defined before including the header liblogger.h , the following code snippet illustrates this :

        #include <liblogger/liblogger_levels.h>
        // The module name for logs done from this file.
        #define LOG_MODULE_NAME "LoggerTest"
        #include <liblogger/liblogger.h>

Why Use a module name.

Associating a module with a (group of) file(s) is very helpful in greping and isolation of logs.

liblogger © 2007 - SourceForge.net Logo