1 /* 2 * Copyright (c) 2025 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 AIP_LOG_H 17 #define AIP_LOG_H 18 19 #include <cstdint> 20 #include "hilog/log.h" 21 22 #ifndef LOG_DOMAIN 23 #define LOG_DOMAIN 0xD001660 24 #endif 25 26 namespace OHOS { 27 namespace DataIntelligence { 28 #ifndef AIP_FUNC_FMT 29 #define AIP_FUNC_FMT "in %{public}s, " 30 #endif 31 32 #ifndef AIP_FUNC_INFO 33 #define AIP_FUNC_INFO __FUNCTION__ 34 #endif 35 36 #define AIP_HILOGD(fmt, ...) \ 37 do { \ 38 HILOG_DEBUG(LOG_CORE, AIP_FUNC_FMT fmt, AIP_FUNC_INFO, ##__VA_ARGS__); \ 39 } while (0) 40 41 #define AIP_HILOGI(fmt, ...) \ 42 do { \ 43 HILOG_INFO(LOG_CORE, AIP_FUNC_FMT fmt, AIP_FUNC_INFO, ##__VA_ARGS__); \ 44 } while (0) 45 46 #define AIP_HILOGW(fmt, ...) \ 47 do { \ 48 HILOG_WARN(LOG_CORE, AIP_FUNC_FMT fmt, AIP_FUNC_INFO, ##__VA_ARGS__); \ 49 } while (0) 50 51 #define AIP_HILOGE(fmt, ...) \ 52 do { \ 53 HILOG_ERROR(LOG_CORE, AIP_FUNC_FMT fmt, AIP_FUNC_INFO, ##__VA_ARGS__); \ 54 } while (0) 55 56 #define AIP_HILOGF(fmt, ...) \ 57 do { \ 58 HILOG_FATAL(LOG_CORE, AIP_FUNC_FMT fmt, AIP_FUNC_INFO, ##__VA_ARGS__); \ 59 } while (0) 60 } // namespace DataIntelligence 61 } // namespace OHOS 62 #endif // AIP_LOG_H 63