1 /** 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: header file for diag log. \n 15 * 16 */ 17 18 #ifndef DIAG_LOG_H 19 #define DIAG_LOG_H 20 21 #include "soc_diag_log.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif 27 #endif 28 29 /** 30 * @defgroup middleware_utils_dfx_log Log 31 * @ingroup middleware_utils_dfx 32 * @{ 33 */ 34 35 /** 36 * @if Eng 37 * @brief Print Error-level diag logs. 38 * @param [in] id log ID (only 0 is supported now) 39 * @param [in] fmt the format information of the log 40 * @param [in] args the parameter list of log (variable number, up to 10) 41 * @retval ERRCODE_SUCC Success 42 * @retval Others ERRCODE_FAIL or other error num. 43 * @else 44 * @brief Error级别diag日志打印 45 * @param [in] id 日志ID(当前只支持0) 46 * @param [in] fmt 打印输出的格式字符串 47 * @param [in] args 参数列表(最多支持10个参数) 48 * @retval ERRCODE_SUCC 成功返回#ERRCODE_SUCC 49 * @retval Others 失败返回#ERRCODE_FAIL或其他返回值 50 * @endif 51 */ 52 #define uapi_diag_error_log(id, fmt, args...) uapi_diag_error_logx(id, fmt, ##args) 53 54 /** 55 * @if Eng 56 * @brief Print Warning-level diag logs. 57 * @param [in] id log ID (only 0 is supported now) 58 * @param [in] fmt the format information of the log 59 * @param [in] args the parameter list of log (variable number, up to 10) 60 * @retval ERRCODE_SUCC Success 61 * @retval Others ERRCODE_FAIL or other error num. 62 * @else 63 * @brief Warning级别diag日志打印 64 * @param [in] id 日志ID(当前只支持0) 65 * @param [in] fmt 打印输出的格式字符串 66 * @param [in] args 参数列表(最多支持10个参数) 67 * @retval ERRCODE_SUCC 成功返回#ERRCODE_SUCC 68 * @retval Others 失败返回#ERRCODE_FAIL或其他返回值 69 * @endif 70 */ 71 #define uapi_diag_warning_log(id, fmt, args...) uapi_diag_warning_logx(id, fmt, ##args) 72 73 /** 74 * @if Eng 75 * @brief Print Info-level diag logs. 76 * @param [in] id log ID (only 0 is supported now) 77 * @param [in] fmt the format information of the log 78 * @param [in] args the parameter list of log (variable number, up to 10) 79 * @retval ERRCODE_SUCC Success 80 * @retval Others ERRCODE_FAIL or other error num. 81 * @else 82 * @brief Info级别diag日志打印 83 * @param [in] id 日志ID(当前只支持0) 84 * @param [in] fmt 打印输出的格式字符串 85 * @param [in] args 参数列表(最多支持10个参数) 86 * @retval ERRCODE_SUCC 成功返回#ERRCODE_SUCC 87 * @retval Others 失败返回#ERRCODE_FAIL或其他返回值 88 * @endif 89 */ 90 #define uapi_diag_info_log(id, fmt, args...) uapi_diag_info_logx(id, fmt, ##args) 91 92 /** 93 * @if Eng 94 * @brief Print Debug-level diag logs. 95 * @param [in] id log ID (only 0 is supported now) 96 * @param [in] fmt the format information of the log 97 * @param [in] args the parameter list of log (variable number, up to 10) 98 * @retval ERRCODE_SUCC Success 99 * @retval Others ERRCODE_FAIL or other error num. 100 * @else 101 * @brief Debug级别diag日志打印 102 * @param [in] id 日志ID(当前只支持0) 103 * @param [in] fmt 打印输出的格式字符串 104 * @param [in] args 参数列表(最多支持10个参数) 105 * @retval ERRCODE_SUCC 成功返回#ERRCODE_SUCC 106 * @retval Others 失败返回#ERRCODE_FAIL或其他返回值 107 * @endif 108 */ 109 #define uapi_diag_debug_log(id, fmt, args...) uapi_diag_debug_logx(id, fmt, ##args) 110 111 /** 112 * @} 113 */ 114 115 #ifdef __cplusplus 116 #if __cplusplus 117 } 118 #endif 119 #endif 120 121 #endif /* DIAG_LOG_H */ 122