log_common.h revision dc94298b510b26eedbe1e8744b92f7c0b41a6006
1/*
2 * Copyright (C) 2017 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 */
16
17#ifndef CHRE_UTIL_LOG_COMMON_H_
18#define CHRE_UTIL_LOG_COMMON_H_
19
20/**
21 * @file
22 * Includes common logging macros and functions that are shared between nanoapps
23 * and the CHRE implementation.
24 */
25
26/**
27 * An inline stub function to direct log messages to when logging is disabled.
28 * This avoids unused variable warnings and will result in no overhead.
29 */
30inline void chreLogNull(const char *fmt, ...) { (void) fmt; }
31
32//! The logging level to specify that no logs are output.
33#define CHRE_LOG_LEVEL_MUTE 0
34
35//! The logging level to specify that only LOGE is output.
36#define CHRE_LOG_LEVEL_ERROR 1
37
38//! The logging level to specify that LOGW and LOGE are output.
39#define CHRE_LOG_LEVEL_WARN 2
40
41//! The logging level to specify that LOGI, LOGW and LOGE are output.
42#define CHRE_LOG_LEVEL_INFO 3
43
44//! The logging level to specify that LOGD, LOGI, LOGW and LOGE are output.
45#define CHRE_LOG_LEVEL_DEBUG 4
46
47#endif  // CHRE_UTIL_LOG_COMMON_H_
48