• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #ifndef BATTERY_LOG_H
17 #define BATTERY_LOG_H
18 
19 #include "beget_ext.h"
20 #include <string>
21 
22 #define CHARGER_LOG_FILE  "charger.log"
23 #define FEATURE_CHARGING  "charger: "
24 
25 
26 #define BATTERY_HILOGE(label, fmt, ...)                                                                            \
27     do {                                                                                                           \
28         InitLogPrint(INIT_LOG_PATH CHARGER_LOG_FILE, INIT_ERROR, label, fmt,             \
29             (STARTUP_FILE_NAME), (__LINE__), (__FUNCTION__), ##__VA_ARGS__);                                       \
30     } while (0)
31 #define BATTERY_HILOGW(label, fmt, ...)                                                                            \
32     do {                                                                                                           \
33         InitLogPrint(INIT_LOG_PATH CHARGER_LOG_FILE, INIT_WARN, label, fmt,              \
34             (STARTUP_FILE_NAME), (__LINE__), (__FUNCTION__), ##__VA_ARGS__);                                       \
35     } while (0)
36 #define BATTERY_HILOGI(label, fmt, ...)                                                                            \
37     do {                                                                                                           \
38         InitLogPrint(INIT_LOG_PATH CHARGER_LOG_FILE, INIT_INFO, label, fmt,              \
39             (STARTUP_FILE_NAME), (__LINE__), (__FUNCTION__), ##__VA_ARGS__);                                       \
40     } while (0)
41 #define BATTERY_HILOGD(label, fmt, ...)                                                                            \
42     do {                                                                                                           \
43         InitLogPrint(INIT_LOG_PATH CHARGER_LOG_FILE, INIT_DEBUG, label, fmt,             \
44             (STARTUP_FILE_NAME), (__LINE__), (__FUNCTION__), ##__VA_ARGS__);                                       \
45     } while (0)
46 
47 #endif // BATTERY_LOG_H
48