• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 
19 /*! \file pvlogger_c.h
20     \brief This file contains basic logger interfaces for common use across platforms.
21        C-callable version
22 
23     This is the main entry point header file for the logger library.  It should be
24     the only one users directly include.
25 */
26 
27 #ifndef PVLOGGER_C_H_INCLUDED
28 #define PVLOGGER_C_H_INCLUDED
29 
30 #include "osclconfig.h"
31 
32 #ifndef OSCL_IMPORT_REF
33 #define OSCL_IMPORT_REF
34 #endif
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 //C-callable logging routines.
42     OSCL_IMPORT_REF void* pvLogger_GetLoggerObject(const char* tag);
43     OSCL_IMPORT_REF int pvLogger_IsActive(void* logger, int log_level);
44     OSCL_IMPORT_REF void pvLogger_LogMsgString(void* logger, int msgID, const char * fmt, ...);
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
50 
51 //Logging instrumentation level default.  To change this for a project, add a definition of
52 //PVLOGGER_C_INST_LEVEL to the osclconfig.h file.  This default sets level to none for release
53 //mode, full logging for debug build.
54 
55 #ifndef PVLOGGER_C_INST_LEVEL
56 #if defined(NDEBUG)
57 #define PVLOGGER_C_INST_LEVEL 0
58 #else
59 #define PVLOGGER_C_INST_LEVEL 5
60 #endif
61 #endif
62 
63 //Instrumentation levels.
64 #define PVLOGMSG_C_INST_REL   0
65 #define PVLOGMSG_C_INST_PROF  1
66 #define PVLOGMSG_C_INST_HLDBG 2
67 #define PVLOGMSG_C_INST_MLDBG 3
68 #define PVLOGMSG_C_INST_LLDBG 4
69 
70 //Logging levels
71 #define PVLOGMSG_C_EMERG 0
72 #define PVLOGMSG_C_ALERT 1
73 #define PVLOGMSG_C_CRIT 2
74 #define PVLOGMSG_C_ERR 3
75 #define PVLOGMSG_C_WARNING 4
76 #define PVLOGMSG_C_NOTICE 5
77 #define PVLOGMSG_C_INFO 6
78 #define PVLOGMSG_C_STACK_TRACE 7
79 #define PVLOGMSG_C_STACK_DEBUG 8
80 
81 /*
82 //Example Usage:
83 
84 #if (PVLOGGER_C_INST_LEVEL > PVLOGMSG_C_INST_LLDBG)
85             if(pvLogger_IsActive(logger ,PVLOGMSG_C_ERR))
86                 pvLogger_LogMsgString( logger ,  0 ,"Some message, value %d", intvalue );
87 
88 #endif
89 */
90 
91 
92 
93 #endif // PVLOGGER_C_H_INCLUDED
94