testapp/src_warn.cpp File Reference


Detailed Description

Sample file illustrating the log priority usage. In this file, we choose logs of priority warn and higher.

Definition in file src_warn.cpp.

#include <liblogger/liblogger_levels.h>
#include <liblogger/liblogger.h>

Go to the source code of this file.

Defines

#define LOG_LEVEL   LOG_LEVEL_WARN
#define LOG_MODULE_NAME   "LogWarnTest"

Functions

int TestFuncWarn ()


Define Documentation

#define LOG_LEVEL   LOG_LEVEL_WARN

Definition at line 10 of file src_warn.cpp.

#define LOG_MODULE_NAME   "LogWarnTest"

Definition at line 12 of file src_warn.cpp.


Function Documentation

int TestFuncWarn (  ) 

Definition at line 15 of file src_warn.cpp.

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 }


liblogger © 2007 - SourceForge.net Logo