• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef TITLE
20 #define TITLE __PRETTY_FUNCTION__
21 #endif
22 #include "hilog/log.h"
23 #include "log_tags.h"
24 
25 static constexpr OHOS::HiviewDFX::HiLogLabel LOG_LABEL = { LOG_CORE, OHOS::LOG_ID_RPC, LOG_TAG };
26 
27 #define DBINDER_LOGF(fmt, args...) \
28     (void)OHOS::HiviewDFX::HiLog::Fatal(LOG_LABEL, "%{public}s %{public}d: " fmt, TITLE, __LINE__, ##args)
29 #define DBINDER_LOGE(fmt, args...) \
30     (void)OHOS::HiviewDFX::HiLog::Error(LOG_LABEL, "%{public}s %{public}d: " fmt, TITLE, __LINE__, ##args)
31 #define DBINDER_LOGW(fmt, args...) \
32     (void)OHOS::HiviewDFX::HiLog::Warn(LOG_LABEL, "%{public}s %{public}d: " fmt, TITLE, __LINE__, ##args)
33 #define DBINDER_LOGI(fmt, args...) \
34     (void)OHOS::HiviewDFX::HiLog::Info(LOG_LABEL, "%{public}s %{public}d: " fmt, TITLE, __LINE__, ##args)
35 #define DBINDER_LOGD(fmt, args...) \
36     (void)OHOS::HiviewDFX::HiLog::Debug(LOG_LABEL, "%{public}s %{public}d: " fmt, TITLE, __LINE__, ##args)
37 
38 
39 #endif // OHOS_IPC_SERVICES_DBINDER_DBINDRR_LOG_H