Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

pvlogger_c.h

Go to the documentation of this file.
00001 
00010 #ifndef PVLOGGER_C_H_INCLUDED
00011 #define PVLOGGER_C_H_INCLUDED
00012 
00013 #include "osclconfig.h"
00014 
00015 #ifndef OSCL_IMPORT_REF
00016 #define OSCL_IMPORT_REF
00017 #endif
00018 
00019 #ifdef __cplusplus
00020 extern "C"
00021 {
00022 #endif
00023 
00024 //C-callable logging routines.
00025     OSCL_IMPORT_REF void* pvLogger_GetLoggerObject(const char* tag);
00026     OSCL_IMPORT_REF int pvLogger_IsActive(void* logger, int log_level);
00027     OSCL_IMPORT_REF void pvLogger_LogMsgString(void* logger, int msgID, const char * fmt, ...);
00028 
00029 #ifdef __cplusplus
00030 }
00031 #endif
00032 
00033 
00034 //Logging instrumentation level default.  To change this for a project, add a definition of
00035 //PVLOGGER_C_INST_LEVEL to the osclconfig.h file.  This default sets level to none for release
00036 //mode, full logging for debug build.
00037 
00038 #ifndef PVLOGGER_C_INST_LEVEL
00039 #if defined(NDEBUG)
00040 #define PVLOGGER_C_INST_LEVEL 0
00041 #else
00042 #define PVLOGGER_C_INST_LEVEL 5
00043 #endif
00044 #endif
00045 
00046 //Instrumentation levels.
00047 #define PVLOGMSG_C_INST_REL   0
00048 #define PVLOGMSG_C_INST_PROF  1
00049 #define PVLOGMSG_C_INST_HLDBG 2
00050 #define PVLOGMSG_C_INST_MLDBG 3
00051 #define PVLOGMSG_C_INST_LLDBG 4
00052 
00053 //Logging levels
00054 #define PVLOGMSG_C_EMERG 0
00055 #define PVLOGMSG_C_ALERT 1
00056 #define PVLOGMSG_C_CRIT 2
00057 #define PVLOGMSG_C_ERR 3
00058 #define PVLOGMSG_C_WARNING 4
00059 #define PVLOGMSG_C_NOTICE 5
00060 #define PVLOGMSG_C_INFO 6
00061 #define PVLOGMSG_C_STACK_TRACE 7
00062 #define PVLOGMSG_C_STACK_DEBUG 8
00063 
00064 /*
00065 //Example Usage:
00066 
00067 #if (PVLOGGER_C_INST_LEVEL > PVLOGMSG_C_INST_LLDBG)
00068                         if(pvLogger_IsActive(logger ,PVLOGMSG_C_ERR))
00069                                 pvLogger_LogMsgString( logger ,  0 ,"Some message, value %d", intvalue );
00070 
00071 #endif
00072 */
00073 
00074 
00075 
00076 #endif // PVLOGGER_C_H_INCLUDED

OSCL API
Posting Version: OPENCORE_20090310