Enabled timer at MAC and SCH [Issue-ID: ODUHIGH-283]
[o-du/l2.git] / src / rlog / rl_common.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /********************************************************************20**
20
21      Name:     Radisys Logging Framework
22      Type:     C include file
23      Desc:     This file contains logging framework include file for library.
24      File:     rl_common.h
25
26 *********************************************************************21*/
27 /*************************************************************************
28 @ description: This is header file is used by logging framework module. This
29 file should not be cirectly included by any other application although it is
30 common file to logging framework and LOG MACROs used by any applicatoin.
31 ***************************************************************************/
32 #ifndef __RL_COMMON_H__
33 #define __RL_COMMON_H__
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 typedef enum {
40         L_ALWAYS=0,
41         L_FATAL,
42         L_ERROR,
43         L_WARNING,
44         L_EVENT,
45         L_INFO,
46         L_DEBUG,
47         L_UNUSED,
48         L_MAX_LOG_LEVEL
49 } R_LOG_LEVEL;
50
51 typedef enum {
52         DBG_CELLID,
53    DBG_PEERID,
54    DBG_ENBID,
55         DBG_MMEID,
56         DBG_CRNTI,
57    DBG_UEIDX,
58         DBG_UEID,
59         DBG_RBID,
60         DBG_LCID,
61         DBG_LCGID,
62         DBG_TRNSID,
63    DBG_INSTID,
64         DBG_MAX_IDs
65 } R_SPL_ARG;
66
67 #ifdef USE_RLOG_DATA_TYPES
68 typedef const char* PSTR;
69 typedef int S32;
70 typedef signed short S16;
71 #else
72 #include "envdep.h"
73 typedef const char* PSTR;
74 #endif
75
76 typedef uint32_t LOGID;
77
78 #ifdef RLOG_ENABLE_TEXT_LOGGING
79 #include <stdio.h>
80 extern FILE* g_fp;
81 void logLev0(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, ...);
82 void logLev1(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t arg1, ...);
83 void logLev2(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t arg1, uint32_t arg2, ...);
84 void logLev3(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t, uint32_t, uint32_t, ...);
85 void logLev4(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, uint32_t, uint32_t, uint32_t, uint32_t, ...);
86 void logLevN(int logLevel, const char* modName, const char* file, int lineno, const char* fmtStr, ...);
87 void logLevE(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, R_SPL_ARG splType,
88    uint32_t splVal, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...);
89 void logLevH(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, PSTR hexdump, int hexlen, ...);
90 void logLevS(PSTR strLogLevel, PSTR modName, PSTR file, int lineno, PSTR fmtStr, PSTR str, ...);
91 #else
92 void logLevH( LOGID logId, R_LOG_LEVEL logLevel, PSTR hex, int hexlen, ...);
93 void logLev0( LOGID logId, R_LOG_LEVEL logLevel, ...);
94 void logLev1( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, ...);
95 void logLev2( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, ...);
96 void logLev3( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, uint32_t arg3, ...);
97 void logLev4( LOGID logId, R_LOG_LEVEL logLevel, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...);
98 void logLevE(LOGID logId, R_LOG_LEVEL logLevel, R_SPL_ARG splType, uint32_t splVal,
99 uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, ...);
100 void logLevS( LOGID logId, R_LOG_LEVEL logLevel, const char* str, ...);
101 #endif
102
103 void hextostr(char* p, PSTR h, int hexlen);
104
105 extern int g_logLevel;
106 extern uint32_t g_modMask;
107 extern const char* g_logStr[L_MAX_LOG_LEVEL]; 
108 extern const char* g_splStr[DBG_MAX_IDs];
109
110 #define RLOG_SEGFAULT_STR "Segmentation Fault Occurred\n%s"
111
112 #ifdef __cplusplus
113 }
114 #endif /* __cplusplus */
115
116 #endif /* __RLOG_COMMON_H__ */