testapp/src_nofilename.cpp

Go to the documentation of this file.
00001 /**
00002  * \file 
00003  * Sample file illustrating the selective disabling of filename
00004  * from appearing in the logs generated from this file.
00005  * */
00006 #include <liblogger/liblogger_levels.h>
00007 // For this file, we choose the logs with priority Info and higher, 
00008 // so logs with lesser priority i.e 
00009 // LogTrace(), LogDebug(), will NOT appear, THEY WILL BE NULL STATEMENTS WITH NO OVERHEAD
00010 #define LOG_LEVEL LOG_LEVEL_INFO
00011 // We Choose not to include the filenames in the log generated from this source file.
00012 #define DISABLE_FILENAMES
00013 // The module name for this file.
00014 #define LOG_MODULE_NAME "ModuleInfoTest"
00015 #include <liblogger/liblogger.h>
00016 
00017 int TestNoFilename()
00018 {
00019         // log the function entry log.
00020         LogFuncEntry();
00021 
00022         LogTrace("Trace log %s %f", "Test", 1.066f);
00023         LogDebug("Debug level log" );
00024         LogInfo("Info level log %d" , 0);
00025         LogWarn("Warn level log" );
00026         LogError("Error level log" );
00027         LogFatal("Fatal level log" );
00028 
00029         if(1)
00030         {
00031                 // log the function exit .
00032                 LogFuncExit();
00033                 return 0;
00034         }
00035         else
00036         {
00037                 // log the function exit .
00038                 LogFuncExit();
00039                 return -1;
00040         }
00041         
00042 }

liblogger © 2007 - SourceForge.net Logo