• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 MISCDEVICE_LOG_H
16 #define MISCDEVICE_LOG_H
17 
18 #include "sensors_errors.h"
19 
20 #undef LOG_DOMAIN
21 #define LOG_DOMAIN 0xD002701
22 
23 namespace OHOS {
24 namespace Sensors {
25 #ifndef MISC_FUNC_FMT
26 #define MISC_FUNC_FMT "in %{public}s "
27 #endif
28 
29 #ifndef MISC_FUNC_INFO
30 #define MISC_FUNC_INFO __FUNCTION__
31 #endif
32 
33 #define MISC_HILOGD(fmt, ...) do { \
34     HILOG_DEBUG(LOG_CORE, MISC_FUNC_FMT fmt, MISC_FUNC_INFO, ##__VA_ARGS__); \
35 } while (0)
36 #define MISC_HILOGI(fmt, ...) do { \
37     HILOG_INFO(LOG_CORE, MISC_FUNC_FMT fmt, MISC_FUNC_INFO, ##__VA_ARGS__); \
38 } while (0)
39 #define MISC_HILOGW(fmt, ...) do { \
40     HILOG_WARN(LOG_CORE, MISC_FUNC_FMT fmt, MISC_FUNC_INFO, ##__VA_ARGS__); \
41 } while (0)
42 #define MISC_HILOGE(fmt, ...) do { \
43     HILOG_ERROR(LOG_CORE, MISC_FUNC_FMT fmt, MISC_FUNC_INFO, ##__VA_ARGS__); \
44 } while (0)
45 #define MISC_LOGF(fmt, ...) do { \
46     HILOG_FATAL(LOG_CORE, MISC_FUNC_FMT fmt, MISC_FUNC_INFO, ##__VA_ARGS__); \
47 } while (0)
48 } // namespace Sensors
49 } // namespace OHOS
50 #endif // MISCDEVICE_LOG_H