1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 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 */ 15 16 #ifndef OHOS_ACELITE_ACE_LOG_H 17 #define OHOS_ACELITE_ACE_LOG_H 18 19 #include "acelite_config.h" 20 21 #if ((FEATURE_ACELITE_HI_LOG_PRINTF == 1) && (FEATURE_ACELITE_MC_LOG_PRINTF == 1)) 22 #error Only one marco can be defined 23 #elif ((FEATURE_ACELITE_HI_LOG_PRINTF == 1) && (TARGET_SIMULATOR == 1)) 24 #error Only one marco can be defined 25 #elif ((FEATURE_ACELITE_MC_LOG_PRINTF == 1) && (TARGET_SIMULATOR == 1)) 26 #error Only one macro can be defined 27 #endif 28 29 #if (FEATURE_ACELITE_HI_LOG_PRINTF == 1) 30 #undef LOG_DOMAIN 31 #undef LOG_TAG 32 #define LOG_DOMAIN 0xD003900 33 #define LOG_TAG "ACE" 34 #ifndef __ICCARM__ 35 #include "hilog/log.h" 36 #else 37 #include "hilog_lite/log.h" 38 #endif 39 #elif (FEATURE_ACELITE_MC_LOG_PRINTF == 1) 40 #include "hilog_lite/log.h" 41 #ifndef HILOG_DEBUG 42 #define HILOG_DEBUG(mod, format, ...) 43 #endif 44 #ifndef HILOG_ERROR 45 #define HILOG_ERROR(mod, format, ...) 46 #endif 47 #ifndef HILOG_FATAL 48 #define HILOG_FATAL(mod, format, ...) 49 #endif 50 #ifndef HILOG_INFO 51 #define HILOG_INFO(mod, format, ...) 52 #endif 53 #ifndef HILOG_WARN 54 #define HILOG_WARN(mod, format, ...) 55 #endif 56 #ifndef HILOG_RACE 57 #define HILOG_RACE(mod, format, ...) 58 #endif 59 #elif (TARGET_SIMULATOR == 1) 60 namespace OHOS { 61 namespace ACELite { 62 typedef enum { HILOG_MODULE_ACE = 1 } HiLogModuleType; 63 64 void HILOG_FATAL(HiLogModuleType mod, const char *msg, ...); 65 void HILOG_ERROR(HiLogModuleType mod, const char *msg, ...); 66 void HILOG_INFO(HiLogModuleType mod, const char *msg, ...); 67 void HILOG_WARN(HiLogModuleType mod, const char *msg, ...); 68 void HILOG_DEBUG(HiLogModuleType mod, const char *msg, ...); 69 } // namespace ACELite 70 } // namespace OHOS 71 #else 72 #error One macro must be defined 73 #endif 74 #endif // OHOS_ACELITE_ACE_LOG_H 75