1115cd2caSopenharmony_ci/*
2115cd2caSopenharmony_ci * Copyright (C) 2021-2022 Huawei Device Co., Ltd.
3115cd2caSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4115cd2caSopenharmony_ci * you may not use this file except in compliance with the License.
5115cd2caSopenharmony_ci * You may obtain a copy of the License at
6115cd2caSopenharmony_ci *
7115cd2caSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8115cd2caSopenharmony_ci *
9115cd2caSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10115cd2caSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11115cd2caSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12115cd2caSopenharmony_ci * See the License for the specific language governing permissions and
13115cd2caSopenharmony_ci * limitations under the License.
14115cd2caSopenharmony_ci */
15115cd2caSopenharmony_ci
16115cd2caSopenharmony_ci#ifndef HILOG_WRAPPER_API_H
17115cd2caSopenharmony_ci#define HILOG_WRAPPER_API_H
18115cd2caSopenharmony_ci
19115cd2caSopenharmony_ci#define CONFIG_HILOG
20115cd2caSopenharmony_ci#ifdef CONFIG_HILOG
21115cd2caSopenharmony_ci
22115cd2caSopenharmony_ci#include "hilog/log.h"
23115cd2caSopenharmony_ci
24115cd2caSopenharmony_ci#ifdef HILOG_FATAL
25115cd2caSopenharmony_ci#undef HILOG_FATAL
26115cd2caSopenharmony_ci#endif
27115cd2caSopenharmony_ci
28115cd2caSopenharmony_ci#ifdef HILOG_ERROR
29115cd2caSopenharmony_ci#undef HILOG_ERROR
30115cd2caSopenharmony_ci#endif
31115cd2caSopenharmony_ci
32115cd2caSopenharmony_ci#ifdef HILOG_WARN
33115cd2caSopenharmony_ci#undef HILOG_WARN
34115cd2caSopenharmony_ci#endif
35115cd2caSopenharmony_ci
36115cd2caSopenharmony_ci#ifdef HILOG_INFO
37115cd2caSopenharmony_ci#undef HILOG_INFO
38115cd2caSopenharmony_ci#endif
39115cd2caSopenharmony_ci
40115cd2caSopenharmony_ci#ifdef HILOG_DEBUG
41115cd2caSopenharmony_ci#undef HILOG_DEBUG
42115cd2caSopenharmony_ci#endif
43115cd2caSopenharmony_ci
44115cd2caSopenharmony_cistatic constexpr OHOS::HiviewDFX::HiLogLabel LOG_LABEL = {LOG_CORE, LOG_DOMAIN, CONTACTSDATA_LOG_TAG};
45115cd2caSopenharmony_ci
46115cd2caSopenharmony_ci#define HILOG_FATAL(...) (void)OHOS::HiviewDFX::HiLog::Fatal(LOG_LABEL, __VA_ARGS__)
47115cd2caSopenharmony_ci#define HILOG_ERROR(...) (void)OHOS::HiviewDFX::HiLog::Error(LOG_LABEL, __VA_ARGS__)
48115cd2caSopenharmony_ci#define HILOG_WARN(...) (void)OHOS::HiviewDFX::HiLog::Warn(LOG_LABEL, __VA_ARGS__)
49115cd2caSopenharmony_ci#define HILOG_INFO(...) (void)OHOS::HiviewDFX::HiLog::Info(LOG_LABEL, __VA_ARGS__)
50115cd2caSopenharmony_ci#define HILOG_DEBUG(...) (void)OHOS::HiviewDFX::HiLog::Debug(LOG_LABEL, __VA_ARGS__)
51115cd2caSopenharmony_ci#else
52115cd2caSopenharmony_ci
53115cd2caSopenharmony_ci#define HILOG_FATAL(...)
54115cd2caSopenharmony_ci#define HILOG_ERROR(...)
55115cd2caSopenharmony_ci#define HILOG_WARN(...)
56115cd2caSopenharmony_ci#define HILOG_INFO(...)
57115cd2caSopenharmony_ci#define HILOG_DEBUG(...)
58115cd2caSopenharmony_ci
59115cd2caSopenharmony_ci#endif // CONFIG_HILOG
60115cd2caSopenharmony_ci
61115cd2caSopenharmony_ci#endif // HILOG_WRAPPER_API_H
62