1 /* 2 * Copyright (c) 2021-2022 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 SAMGR_PROXY_INCLUDE_SAM_LOG_H_ 17 #define SAMGR_PROXY_INCLUDE_SAM_LOG_H_ 18 19 #include "hilog/log.h" 20 21 namespace OHOS { 22 #ifdef SAMGR_PROXY 23 static constexpr OHOS::HiviewDFX::HiLogLabel SYSTEM_ABLILITY_LABEL = { 24 LOG_CORE, 25 0xD001800, 26 "SA_CLIENT" 27 }; 28 #else 29 static constexpr OHOS::HiviewDFX::HiLogLabel SYSTEM_ABLILITY_LABEL = { 30 LOG_CORE, 31 0xD001800, 32 "SAMGR" 33 }; 34 #endif 35 36 #ifdef HILOGF 37 #undef HILOGF 38 #endif 39 40 #ifdef HILOGE 41 #undef HILOGE 42 #endif 43 44 #ifdef HILOGW 45 #undef HILOGW 46 #endif 47 48 #ifdef HILOGI 49 #undef HILOGI 50 #endif 51 52 #ifdef HILOGD 53 #undef HILOGD 54 #endif 55 56 #define HILOGF(...) (void)OHOS::HiviewDFX::HiLog::Fatal(SYSTEM_ABLILITY_LABEL, __VA_ARGS__) 57 #define HILOGE(...) (void)OHOS::HiviewDFX::HiLog::Error(SYSTEM_ABLILITY_LABEL, __VA_ARGS__) 58 #define HILOGW(...) (void)OHOS::HiviewDFX::HiLog::Warn(SYSTEM_ABLILITY_LABEL, __VA_ARGS__) 59 #define HILOGI(...) (void)OHOS::HiviewDFX::HiLog::Info(SYSTEM_ABLILITY_LABEL, __VA_ARGS__) 60 #define HILOGD(...) (void)OHOS::HiviewDFX::HiLog::Debug(SYSTEM_ABLILITY_LABEL, __VA_ARGS__) 61 } // namespace OHOS 62 63 #endif // #ifndef SAMGR_PROXY_INCLUDE_SAM_LOG_H_ 64