testapp/src_nologs.cpp

Go to the documentation of this file.
00001 /**
00002  * \file 
00003  * Sample file illustrating selectively disabling the logs from
00004  * appearing , from a source file.
00005  * */
00006 #include <liblogger/liblogger_levels.h>
00007 // For this file, we disable all the logs. - NO LOGS FROM THIS FILE WILL APPEAR.
00008 // ALL LOGS IN THIS FILE WILL BE NULL STATEMENTS WITH NO OVERHEAD.
00009 #define LOG_LEVEL LOG_LEVEL_DISABLED
00010 #include <liblogger/liblogger.h>
00011 
00012 int TestFuncNoLogs()
00013 {
00014         // log the function entry log.
00015         LogFuncEntry();
00016 
00017         LogTrace("Trace log %s %f", "Test", 1.066f);
00018         LogDebug("Debug level log" );
00019         LogInfo("Info level log %d" , 0);
00020         LogWarn("Warn level log" );
00021         LogError("Error level log" );
00022         LogFatal("Fatal level log" );
00023 
00024         if(1)
00025         {
00026                 // log the function exit .
00027                 LogFuncExit();
00028                 return 0;
00029         }
00030         else
00031         {
00032                 // log the function exit .
00033                 LogFuncExit();
00034                 return -1;
00035         }
00036         
00037 }

liblogger © 2007 - SourceForge.net Logo