1 /* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 13 #ifndef TEE_LOG_H 14 #define TEE_LOG_H 15 16 #ifndef CONFIG_ARMPC_PLATFORM 17 #include "hilog/log_c.h" 18 #endif 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 #ifdef LOG_TAG 25 #undef LOG_TAG 26 #endif 27 #define LOG_TAG "tee_client" 28 29 #ifdef LOG_DOMAIN 30 #undef LOG_DOMAIN 31 #endif 32 #define LOG_DOMAIN 0xD002F00 33 34 #ifndef CONFIG_ARMPC_PLATFORM 35 #define tlogv(...) HILOG_DEBUG(LOG_CORE, __VA_ARGS__) 36 37 #define tlogd(...) HILOG_DEBUG(LOG_CORE, __VA_ARGS__) 38 39 #define tlogi(...) HILOG_INFO(LOG_CORE, __VA_ARGS__) 40 41 #define tlogw(...) HILOG_WARN(LOG_CORE, __VA_ARGS__) 42 43 #define tloge(...) HILOG_ERROR(LOG_CORE, __VA_ARGS__) 44 #else 45 #define tlogv(...) printf(__VA_ARGS__) 46 47 #define tlogd(...) printf(__VA_ARGS__) 48 49 #define tlogi(...) printf(__VA_ARGS__) 50 51 #define tlogw(...) printf(__VA_ARGS__) 52 53 #define tloge(...) printf(__VA_ARGS__) 54 #endif 55 56 #ifdef __cplusplus 57 } 58 #endif 59 60 #endif 61