blob: b85fee562d469c2eddfd1057846c665a223d2e25 [file] [log] [blame]
Zhigang Yu3954cf72017-10-12 14:01:17 +08001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 * @author Tellen Yu
16 * @version 2.0
17 * @date 2014/11/04
18 * @par function description:
19 * - 1 common define for system control both Android and recovery mode
20 */
21
22#ifndef _SYS_COMMON_H
23#define _SYS_COMMON_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#define CC_MAX_LINE_LEN 512
30#define MAX_STR_LEN 4096
31#define MODE_LEN 64
32
33#ifdef RECOVERY_MODE
34#include <cutils/klog.h>
35#define SYS_LOGE(x...) KLOG_ERROR("systemcontrol", x)
36#define SYS_LOGD(x...) KLOG_DEBUG("systemcontrol", x)
37#define SYS_LOGV(x...) KLOG_NOTICE("systemcontrol", x)
38#define SYS_LOGI(x...) KLOG_INFO("systemcontrol", x)
39#else
40#include <utils/Log.h>
41#define SYS_LOGE ALOGE
42#define SYS_LOGD ALOGD
43#define SYS_LOGV ALOGV
44#define SYS_LOGI ALOGI
45#endif
46
47enum {
48 LOG_LEVEL_0 = 0,
49 LOG_LEVEL_1 = 1,//debug property
50 LOG_LEVEL_2 = 2,//debug sysfs read write, parse config file
51 LOG_LEVEL_TOTAL = 3
52};
53
54#define LOG_LEVEL_DEFAULT LOG_LEVEL_1
55
56#ifdef __cplusplus
57}
58#endif
59#endif // _SYS_COMMON_H