1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /********************************************************************20**
21 Name: Radisys Logging Framework
23 Desc: This file contains logging framework include file for library.
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__
67 #ifdef USE_RLOG_DATA_TYPES
68 typedef const char* PSTR;
70 typedef signed short S16;
73 typedef const char* PSTR;
76 typedef uint32_t LOGID;
78 #ifdef RLOG_ENABLE_TEXT_LOGGING
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, ...);
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, ...);
103 void hextostr(char* p, PSTR h, int hexlen);
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];
110 #define RLOG_SEGFAULT_STR "Segmentation Fault Occurred\n%s"
114 #endif /* __cplusplus */
116 #endif /* __RLOG_COMMON_H__ */