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