1 /*
2  * Copyright (c) 2021-2023 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 /**
17  * @addtogroup DriverUtils
18  * @{
19  *
20  * @brief Defines common macros and interfaces of the driver module.
21  *
22  * This module provides interfaces for log printing, doubly linked list operations, and work queues.
23  *
24  * @since 1.0
25  */
26 
27 /**
28  * @file hdf_log_adapter.h
29  *
30  * @brief Provides the implementation of hdf_log. HiLog macros are used to implement the functions of macros,
31  * such as <b>HDF_LOGV</b>. Service modules do not use this file.
32  *
33  * @since 1.0
34  */
35 
36 #ifndef HDF_LOG_ADAPTER_H
37 #define HDF_LOG_ADAPTER_H
38 
39 #include "hilog/log.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif /* __cplusplus */
44 
45 /**
46  * @brief Defines the log domain of the HDF.
47  */
48 #undef LOG_DOMAIN
49 #define LOG_DOMAIN 0xD002510
50 
51 /**
52  * @brief Defines the default log label of the HDF.
53  */
54 #ifndef LOG_TAG
55 #define LOG_TAG HDF
56 #endif
57 
58 /**
59  * @brief Adapts to printing information of the <b>verbose</b> level of the HiLog module.
60  */
61 #define HDF_LOGV_WRAPPER(fmt, arg...) HILOG_DEBUG(LOG_CORE, fmt, ##arg)
62 
63 /**
64  * @brief Adapts to printing information of the <b>debug</b> level of the HiLog module.
65  */
66 #define HDF_LOGD_WRAPPER(fmt, arg...) HILOG_DEBUG(LOG_CORE, fmt, ##arg)
67 
68 /**
69  * @brief Adapts to printing information of the <b>info</b> level of the HiLog module.
70  */
71 #define HDF_LOGI_WRAPPER(fmt, arg...) HILOG_INFO(LOG_CORE, fmt, ##arg)
72 
73 /**
74  @brief Adapts to printing information of the <b>warning</b> level of the HiLog module.
75  */
76 #define HDF_LOGW_WRAPPER(fmt, arg...) HILOG_WARN(LOG_CORE, fmt, ##arg)
77 
78 /**
79  * @brief Adapts to printing information of the <b>error</b> level of the HiLog module.
80  */
81 #define HDF_LOGE_WRAPPER(fmt, arg...) HILOG_ERROR(LOG_CORE, fmt, ##arg)
82 
83 #ifdef __cplusplus
84 }
85 #endif /* __cplusplus */
86 
87 #endif /* HDF_LOG_ADAPTER_H */
88