• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 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 #ifndef OHOS_IPC_LOG_H
16 #define OHOS_IPC_LOG_H
17 
18 #include "hilog/log.h"
19 
20 #undef LOG_DOMAIN
21 #undef LOG_TAG
22 #define LOG_DOMAIN 0xD001500
23 #define LOG_TAG "Communication"
24 
25 #ifdef __cplusplus
26 #if __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29 #endif /* __cplusplus */
30 
31 #define HILOG_X(op, fmt, ...)                                 \
32     do {                                                      \
33         op(LOG_CORE, fmt, ##__VA_ARGS__);                     \
34     } while (0)
35 
36 #define IPC_LOG(level, fmt, ...)   IPC_LOG_##level(fmt, ##__VA_ARGS__)
37 #define IPC_LOG_DEBUG(fmt, ...)    HILOG_X(HILOG_DEBUG, fmt, ##__VA_ARGS__)
38 #define IPC_LOG_INFO(fmt, ...)     HILOG_X(HILOG_INFO,  fmt, ##__VA_ARGS__)
39 #define IPC_LOG_WARN(fmt, ...)     HILOG_X(HILOG_WARN,  fmt, ##__VA_ARGS__)
40 #define IPC_LOG_ERROR(fmt, ...)    HILOG_X(HILOG_ERROR, fmt, ##__VA_ARGS__)
41 #define IPC_LOG_FATAL(fmt, ...)    HILOG_X(HILOG_FATAL, fmt, ##__VA_ARGS__)
42 
43 
44 #ifdef __cplusplus
45 #if __cplusplus
46 }
47 #endif /* __cplusplus */
48 #endif /* __cplusplus */
49 #endif
50