1 /* 2 * Copyright (C) 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_IPC_SERVICES_DBINDER_DBINDRR_LOG_H 17 #define OHOS_IPC_SERVICES_DBINDER_DBINDRR_LOG_H 18 19 #include "hilog/log.h" 20 #include "log_tags.h" 21 22 static constexpr OHOS::HiviewDFX::HiLogLabel LOG_LABEL = { LOG_CORE, OHOS::LOG_ID_RPC_COMMON, LOG_TAG }; 23 24 #define DBINDER_LOGF(LOG_LABEL, fmt, args...) \ 25 HILOG_IMPL(LOG_CORE, LOG_FATAL, LOG_LABEL.domain, LOG_LABEL.tag, \ 26 "%{public}s %{public}d: " fmt, __FUNCTION__, __LINE__, ##args) 27 #define DBINDER_LOGE(LOG_LABEL, fmt, args...) \ 28 HILOG_IMPL(LOG_CORE, LOG_ERROR, LOG_LABEL.domain, LOG_LABEL.tag, \ 29 "%{public}s %{public}d: " fmt, __FUNCTION__, __LINE__, ##args) 30 #define DBINDER_LOGW(LOG_LABEL, fmt, args...) \ 31 HILOG_IMPL(LOG_CORE, LOG_WARN, LOG_LABEL.domain, LOG_LABEL.tag, \ 32 "%{public}s %{public}d: " fmt, __FUNCTION__, __LINE__, ##args) 33 #define DBINDER_LOGI(LOG_LABEL, fmt, args...) \ 34 HILOG_IMPL(LOG_CORE, LOG_INFO, LOG_LABEL.domain, LOG_LABEL.tag, \ 35 "%{public}s %{public}d: " fmt, __FUNCTION__, __LINE__, ##args) 36 #define DBINDER_LOGD(LOG_LABEL, fmt, args...) \ 37 HILOG_IMPL(LOG_CORE, LOG_DEBUG, LOG_LABEL.domain, LOG_LABEL.tag, \ 38 "%{public}s %{public}d: " fmt, __FUNCTION__, __LINE__, ##args) 39 40 41 #endif // OHOS_IPC_SERVICES_DBINDER_DBINDRR_LOG_H 42