1 /* 2 * Copyright (c) 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 RME_LOG_DOMAIN_H 17 #define RME_LOG_DOMAIN_H 18 19 #include <cstdint> 20 #include "hilog/log.h" 21 22 namespace OHOS { 23 namespace RmeLogDomain { 24 constexpr uint32_t COMMON = 0xD006600; 25 constexpr uint32_t RME_SERVICE = 0xD006601; 26 constexpr uint32_t RME_TEST = 0xD006602; 27 constexpr uint32_t RME_INTELLISENSE = 0xD006604; 28 29 /* 30 #ifdef RME_LOGF 31 #undef RME_LOGF 32 #endif 33 34 #ifdef RME_LOGE 35 #undef RME_LOGE 36 #endif 37 38 #ifdef RME_LOGW 39 #undef RME_LOGW 40 #endif 41 42 #ifdef RME_LOGI 43 #undef RME_LOGI 44 #endif 45 46 #ifdef RME_LOGD 47 #undef RME_LOGD 48 #endif 49 */ 50 51 #define DEFINE_RMELOG_LABEL(name) \ 52 static constexpr OHOS::HiviewDFX::HiLogLabel RME_LOG_LABEL = {LOG_CORE, OHOS::RmeLogDomain::COMMON, name} 53 #define DEFINE_RMELOG_INTELLISENSE(name) \ 54 static constexpr OHOS::HiviewDFX::HiLogLabel RME_LOG_LABEL = {LOG_CORE, OHOS::RmeLogDomain::RME_INTELLISENSE, name} 55 #define DEFINE_RMELOG_SERVICE(name) \ 56 static constexpr OHOS::HiviewDFX::HiLogLabel RME_LOG_LABEL = {LOG_CORE, OHOS::RmeLogDomain::RME_SERVICE, name} 57 #define DEFINE_RMELOG_TEST(name) \ 58 static constexpr OHOS::HiviewDFX::HiLogLabel RME_LOG_LABEL = {LOG_CORE, OHOS::RmeLogDomain::RME_TEST, name} 59 60 #define RME_LOGF(...) (void)OHOS::HiviewDFX::HiLog::Fatal(RME_LOG_LABEL, ##__VA_ARGS__) 61 #define RME_LOGE(...) (void)OHOS::HiviewDFX::HiLog::Error(RME_LOG_LABEL, ##__VA_ARGS__) 62 #define RME_LOGW(...) (void)OHOS::HiviewDFX::HiLog::Warn(RME_LOG_LABEL, ##__VA_ARGS__) 63 #define RME_LOGI(...) (void)OHOS::HiviewDFX::HiLog::Info(RME_LOG_LABEL, ##__VA_ARGS__) 64 #define RME_LOGD(...) (void)OHOS::HiviewDFX::HiLog::Debug(RME_LOG_LABEL, ##__VA_ARGS__) 65 } // namespace RmeLogDomain 66 } // namespace OHOS 67 #endif // RME_LOG_DOMAIN_H 68