|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
|
* Copyright (c) Huawei Technologies Co., Ltd. 2013-2020. All rights reserved.
|
|
|
|
|
* Description: Los_printf HeadFile
|
|
|
|
|
* Author: Huawei LiteOS Team
|
|
|
|
|
* Create: 2013-01-01
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
|
* are permitted provided that the following conditions are met:
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
|
|
|
* conditions and the following disclaimer.
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
|
|
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
|
|
|
* provided with the distribution.
|
|
|
|
|
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
|
|
|
* to endorse or promote products derived from this software without specific prior written
|
|
|
|
|
* permission.
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
* --------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @defgroup los_printf Printf
|
|
|
|
|
* @ingroup kernel
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _LOS_PRINTF_H
|
|
|
|
|
#define _LOS_PRINTF_H
|
|
|
|
|
|
|
|
|
|
#include "stdarg.h"
|
|
|
|
|
#include "los_config.h"
|
|
|
|
|
#include "los_typedef.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
#if __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
#ifdef LOSCFG_SHELL_LK
|
|
|
|
|
extern void LOS_LkPrint(int level, const char *func, int line, const char *fmt, ...);
|
|
|
|
|
#endif
|
|
|
|
|
/*LOS_LkPrint <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><C2B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
level<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD>Ϣ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
func<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD>Ϣ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<E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FBD>д<EFBFBD>ӡ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><EFBFBD>ݲ<EFBFBD>ͬ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD>Ի<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><EFBFBD><EFBFBD><EFBFBD>塣*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* log print level definition, LOS_EMG_LEVEL is set to 0, it means the log is emergency.
|
|
|
|
|
*/
|
|
|
|
|
#define LOS_EMG_LEVEL 0
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* log print level definition, LOS_COMMOM_LEVEL is set to 1, it means the log is common.
|
|
|
|
|
*/
|
|
|
|
|
#define LOS_COMMOM_LEVEL (LOS_EMG_LEVEL + 1)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* log print level definition, LOS_ERR_LEVEL is set to 2, it means it is a error log.
|
|
|
|
|
*/
|
|
|
|
|
#define LOS_ERR_LEVEL (LOS_COMMOM_LEVEL + 1)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* log print level definition, LOS_WARN_LEVEL is set to 3, it means it is a warning log.
|
|
|
|
|
*/
|
|
|
|
|
#define LOS_WARN_LEVEL (LOS_ERR_LEVEL + 1)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* log print level definition, LOS_INFO_LEVEL is set to 4, it means the log is an information.
|
|
|
|
|
*/
|
|
|
|
|
#define LOS_INFO_LEVEL (LOS_WARN_LEVEL + 1)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* log print level definition, LOS_DEBUG_LEVEL is set to 5, it means it is a debug log.
|
|
|
|
|
*/
|
|
|
|
|
#define LOS_DEBUG_LEVEL (LOS_INFO_LEVEL + 1)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* The default log print level. PRINT_LEVEL is set to debug log level if
|
|
|
|
|
* LOSCFG_SHELL_LK is defined, otherwise PRINT_LEVEL is set to error log level.
|
|
|
|
|
* The default log print level means only print the log which its level value
|
|
|
|
|
* is lower than or equal to the PRINT_LEVEL.
|
|
|
|
|
*/
|
|
|
|
|
#ifdef LOSCFG_SHELL_LK
|
|
|
|
|
#define PRINT_LEVEL LOS_DEBUG_LEVEL
|
|
|
|
|
#else
|
|
|
|
|
#define PRINT_LEVEL LOS_ERR_LEVEL
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
typedef VOID (*pf_OUTPUT)(const CHAR *fmt, ...);
|
|
|
|
|
/*<2A><><EFBFBD>δ<EFBFBD><CEB4>붨<EFBFBD><EBB6A8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ PRINT_LEVEL <20>ĺ<EFBFBD><C4BA>Լ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ pf_OUTPUT <20>ĺ<EFB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EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> fmt <EFBFBD>Ϳɱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> ...<EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print data.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Print argument(s) according to fmt.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type char*. It controls the ouput format as in C printf.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see printf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
extern void dprintf(const char *fmt, ...);
|
|
|
|
|
|
|
|
|
|
#define diag_printf dprintf
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print debug log.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Define function macros PRINT_DEBUG. The Function can print debug log according to fmt
|
|
|
|
|
* when the PRINT_LEVEL is set to LOS_DEBUG_LEVEL.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type: const CHAR *. It controls the ouput format as in C printf.
|
|
|
|
|
* @param args [IN] It point to the variable parameters.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see dprintf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PRINT_DEBUG
|
|
|
|
|
#if PRINT_LEVEL < LOS_DEBUG_LEVEL
|
|
|
|
|
#define PRINT_DEBUG(fmt, ...)
|
|
|
|
|
#else
|
|
|
|
|
#ifdef LOSCFG_SHELL_LK
|
|
|
|
|
#define PRINT_DEBUG(fmt, ...) LOS_LkPrint(LOS_DEBUG_LEVEL, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
|
|
|
|
|
#else
|
|
|
|
|
#define PRINT_DEBUG(fmt, ...) do { \
|
|
|
|
|
(dprintf("[DEBUG] "), dprintf(fmt, ##__VA_ARGS__)); \
|
|
|
|
|
} while (0)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD> PRINT_DEBUG δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFB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BD><EFBFBD><EFBFBD><EFBFBD> __FUNCTION__<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ǰ<EFBFBD>к<EFBFBD> __LINE__<EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD> fmt<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀɱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> ...
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռλ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PRINT_DEBUG <EFBFBD>걻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> [DEBUG] <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD>*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print information log.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Define function macros PRINT_INFO. The Function can print information log according to fmt
|
|
|
|
|
* when the PRINT_LEVEL is greater than or equal to LOS_INFO_LEVEL.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type: const CHAR *. It controls the ouput format as in C printf.
|
|
|
|
|
* @param args [IN] It point to the variable parameters.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see dprintf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PRINT_INFO
|
|
|
|
|
#if PRINT_LEVEL < LOS_INFO_LEVEL
|
|
|
|
|
#define PRINT_INFO(fmt, ...)
|
|
|
|
|
#else
|
|
|
|
|
#ifdef LOSCFG_SHELL_LK
|
|
|
|
|
#define PRINT_INFO(fmt, ...) LOS_LkPrint(LOS_INFO_LEVEL, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
|
|
|
|
|
#else
|
|
|
|
|
#define PRINT_INFO(fmt, ...) do { \
|
|
|
|
|
(dprintf("[INFO] "), dprintf(fmt, ##__VA_ARGS__)); \
|
|
|
|
|
} while (0)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD> PRINT_INFO δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD> PRINT_LEVEL <20>Ƿ<EFBFBD>С<EFBFBD><D0A1> LOS_INFO_LEVEL<45><4C>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFB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FBD>ǰ<EFBFBD>к<EFBFBD> __LINE__<EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD> fmt<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀɱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> ... <EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռλ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PRINT_INFO <EFBFBD>걻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> [INFO] <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD>*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print warning log.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Define function macros PRINT_WARN. The Function can print warning log according to fmt
|
|
|
|
|
* when the PRINT_LEVEL is greater than or equal to LOS_WARN_LEVEL.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type: const CHAR *. It controls the ouput format as in C printf.
|
|
|
|
|
* @param args [IN] It point to the variable parameters.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see dprintf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PRINT_WARN
|
|
|
|
|
#if PRINT_LEVEL < LOS_WARN_LEVEL
|
|
|
|
|
#define PRINT_WARN(fmt, ...)
|
|
|
|
|
#else
|
|
|
|
|
#ifdef LOSCFG_SHELL_LK
|
|
|
|
|
#define PRINT_WARN(fmt, ...) LOS_LkPrint(LOS_WARN_LEVEL, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
|
|
|
|
|
#else
|
|
|
|
|
#define PRINT_WARN(fmt, ...) do { \
|
|
|
|
|
(dprintf("[WARN] "), dprintf(fmt, ##__VA_ARGS__)); \
|
|
|
|
|
} while (0)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD> PRINT_WARN δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD> PRINT_LEVEL <20>Ƿ<EFBFBD>С<EFBFBD><D0A1> LOS_WARN_LEVEL<45><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><C7A3><EFBFBD><EFBFBD><EFBFBD> PRINT_WARN <20>궨<EFBFBD><EAB6A8>Ϊ<EFBFBD>ղ<EFBFBD><D5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2A3ACBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFB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<EFBFBD><EFBFBD><EFBFBD> fmt<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀɱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> ... <EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռλ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PRINT_WARN <EFBFBD>걻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> [WARN] <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD>*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print error log.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Define function macros PRINT_ERR. The Function can print error log according to fmt
|
|
|
|
|
* when the PRINT_LEVEL is greater than or equal to LOS_ERR_LEVEL.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type: const CHAR *. It controls the ouput format as in C printf.
|
|
|
|
|
* @param args [IN] It point to the variable parameters.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see dprintf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PRINT_ERR
|
|
|
|
|
#if PRINT_LEVEL < LOS_ERR_LEVEL
|
|
|
|
|
#define PRINT_ERR(fmt, ...)
|
|
|
|
|
#else
|
|
|
|
|
#ifdef LOSCFG_SHELL_LK
|
|
|
|
|
#define PRINT_ERR(fmt, ...) LOS_LkPrint(LOS_ERR_LEVEL, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
|
|
|
|
|
#else
|
|
|
|
|
#define PRINT_ERR(fmt, ...) do { \
|
|
|
|
|
(dprintf("[ERR] "), dprintf(fmt, ##__VA_ARGS__)); \
|
|
|
|
|
} while (0)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD> PRINT_ERR δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD> PRINT_LEVEL <20>Ƿ<EFBFBD>С<EFBFBD><D0A1> LOS_ERR_LEVEL<45><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><C7A3><EFBFBD><EFBFBD><EFBFBD> PRINT_ERR <20>궨<EFBFBD><EAB6A8>Ϊ<EFBFBD>ղ<EFBFBD><D5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2A3ACBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> LOSCFG_SHELL_LK <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ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EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռλ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PRINT_ERR <EFBFBD>걻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> [ERR] <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD>*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print common log.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Define function macros PRINTK. The Function can print common log according to fmt
|
|
|
|
|
* when the PRINT_LEVEL is greater than or equal to LOS_COMMOM_LEVEL.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type: const CHAR *. It controls the ouput format as in C printf.
|
|
|
|
|
* @param args [IN] It point to the variable parameters.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see dprintf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PRINTK
|
|
|
|
|
#if PRINT_LEVEL < LOS_COMMOM_LEVEL
|
|
|
|
|
#define PRINTK(fmt, ...)
|
|
|
|
|
#else
|
|
|
|
|
#ifdef LOSCFG_SHELL_LK
|
|
|
|
|
#define PRINTK(fmt, ...) LOS_LkPrint(LOS_COMMOM_LEVEL, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
|
|
|
|
|
#else
|
|
|
|
|
#define PRINTK(fmt, ...) dprintf(fmt, ##__VA_ARGS__)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
/*<2A><><EFBFBD>δ<EFBFBD><CEB4>붨<EFBFBD><EBB6A8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϊ PRINTK <20>ĺꡣ
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> PRINTK δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD> PRINT_LEVEL <EFBFBD>Ƿ<EFBFBD>С<EFBFBD><EFBFBD> LOS_COMMOM_LEVEL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PRINTK <EFBFBD>궨<EFBFBD><EFBFBD>Ϊ<EFBFBD>ղ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> LOSCFG_SHELL_LK <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>PRINTK <EFBFBD>걻<EFBFBD><EFBFBD><EFBFBD><E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>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռλ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PRINTK <EFBFBD>걻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD>*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print emergency log.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Define function macros PRINT_EMG. The Function can print emergency log according to fmt
|
|
|
|
|
* when the PRINT_LEVEL is greater than or equal to LOS_EMG_LEVEL.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type: const CHAR *. It controls the ouput format as in C printf.
|
|
|
|
|
* @param args [IN] It point to the variable parameters.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see dprintf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PRINT_EMG
|
|
|
|
|
#if PRINT_LEVEL < LOS_EMG_LEVEL
|
|
|
|
|
#define PRINT_EMG(fmt, ...)
|
|
|
|
|
#else
|
|
|
|
|
#define PRINT_EMG(fmt, ...) do { \
|
|
|
|
|
(dprintf("[EMG] "), dprintf(fmt, ##__VA_ARGS__)); \
|
|
|
|
|
} while (0)
|
|
|
|
|
#endif
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FBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD>*/
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup los_printf
|
|
|
|
|
* @brief Format and print log.
|
|
|
|
|
*
|
|
|
|
|
* @par Description:
|
|
|
|
|
* Define function macros PRINT_RELEASE. The Function can print argument(s) according to fmt.
|
|
|
|
|
* It is same with dprintf function.
|
|
|
|
|
*
|
|
|
|
|
* @attention
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* @param fmt [IN] Type: const CHAR *. It controls the ouput format as in C printf.
|
|
|
|
|
* @param args [IN] It point to the variable parameters.
|
|
|
|
|
*
|
|
|
|
|
* @retval None.
|
|
|
|
|
* @par Dependency:
|
|
|
|
|
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
|
|
|
|
|
* @see dprintf
|
|
|
|
|
* @since Huawei LiteOS V100R001C00
|
|
|
|
|
*/
|
|
|
|
|
#ifndef PRINT_RELEASE
|
|
|
|
|
#define PRINT_RELEASE(fmt, ...) dprintf(fmt, ##__VA_ARGS__)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
#if __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
|
|
#endif /* _LOS_PRINTF_H */
|