1 /******************************************************************************
3 * Copyright (c) 2020 ICT/CAS.
5 * Licensed under the O-RAN Software License, Version 1.0 (the "Software 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 * https://www.o-ran.org/software
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.
17 *******************************************************************************/
21 #ifndef PLATFORM_INCLUDE_PLAT_SYSLOG_H_
22 #define PLATFORM_INCLUDE_PLAT_SYSLOG_H_
24 #include "vos_common.h"
27 typedef enum _tag_SYSLOG_LEVEL
29 SYSLOG_CRIT = 1, ///< critical conditions
30 SYSLOG_ERR, ///< error conditions
31 SYSLOG_WARNING, ///< warning conditions
32 SYSLOG_INFO, ///< informational
33 SYSLOG_DEBUG, ///< debug info
34 VOS_SYSLOGLEVELS_NUM ///< max
40 * @param[in] module_id 模块ID
41 * @param[in] iLog_Level Log等级
42 * @param[in] content Log内容,fmt字符串
43 * @param[in] arg... fmt中要输出的变量
46 #define VOS_log(module_id, iLog_Level, content,...)\
47 VOS_SysLog(module_id, iLog_Level, __FILE__, __LINE__, __func__, content,##__VA_ARGS__);
51 * 指定参数日志记录,只支持打印 %d 类型,传参必须为INT
52 * @param[in] module_id 模块ID
53 * @param[in] iLog_Level Log等级
54 * @param[in] para_no 参数的数量,最多为5
55 * @param[in] content Log内容,fmt字符串
56 * @param[in] arg... fmt中要输出的变量
59 #define VOS_Nlog(module_id, iLog_Level, para_no, content,...) \
60 VOS_NsysLog(module_id, iLog_Level, __FILE__, __LINE__, __func__, para_no, content,##__VA_ARGS__);
64 * 指定参数日志记录,只支持打印 %ld %lu %lx 类型,传参必须为LONG ULONG
65 * @param[in] module_id 模块ID
66 * @param[in] iLog_Level Log等级
67 * @param[in] para_no 参数的数量,最多为5
68 * @param[in] content Log内容,fmt字符串
69 * @param[in] arg... fmt中要输出的变量
72 #define VOS_Nlog2(module_id, iLog_Level, para_no, content,...) \
73 VOS_NsysLog_2(module_id, iLog_Level, __FILE__, __LINE__, __func__, para_no, content,##__VA_ARGS__);
77 * 指定参数日志记录,只支持打印 %ld %lu %lx %d %u %x %s 类型
78 * @param[in] module_id 模块ID
79 * @param[in] iLog_Level Log等级
80 * @param[in] content Log内容,fmt字符串
81 * @param[in] arg... fmt中要输出的变量
84 #define VOS_Nlog2ex(module_id, iLog_Level,content,...) \
85 VOS_NsysLog_2ex(module_id, iLog_Level, __FILE__, __LINE__, __func__,content,##__VA_ARGS__);
87 extern VOID VOS_SysLog(ULONG module_id, ULONG iLog_Level,CONST CHAR *file, LONG lineno,CONST CHAR *func, CONST CHAR *content, ... );
88 extern VOID VOS_NsysLog(ULONG module_id, ULONG iLog_Level, CONST CHAR *file, LONG lineno,CONST CHAR *func, UINT para_no, CONST CHAR * content, ... );
89 extern VOID VOS_NsysLog_2(ULONG module_id, ULONG iLog_Level,CONST CHAR *file, LONG lineno,CONST CHAR *func,UINT para_no,CONST CHAR *content, ... );
90 extern VOID VOS_NsysLog_2ex(ULONG module_id, ULONG iLog_Level,CONST CHAR *file, LONG lineno,CONST CHAR *func,CONST CHAR *content, ... );
93 #endif /* PLATFORM_INCLUDE_PLAT_SYSLOG_H_ */