10. Selectively Disabling Filenames from appearing in log.

Depending on the compilation path of the sources, the filenames might be very long and not desirable to appear in the log. To prevent filenames from appearing in the log, #define DISABLE_FILENAMES before including the header liblogger.h, the following example illustrates this :
        #include <liblogger/liblogger_levels.h>
        // For this file, we choose the logs with priority Info and higher, 
        // so logs with lesser priority i.e 
        // LogTrace(), LogDebug(), will NOT appear, THEY WILL BE NULL STATEMENTS WITH NO OVERHEAD
        #define LOG_LEVEL LOG_LEVEL_INFO
        // We Choose not to include the filenames in the log generated from this source file.
        #define DISABLE_FILENAMES
        // The module name for this file.
        #define LOG_MODULE_NAME "ModuleInfoTest"
        #include <liblogger/liblogger.h>

liblogger © 2007 - SourceForge.net Logo