2
* Copyright (C) 2005-2017 The Android Open Source Project
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
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
19
#include <android/log.h>
22
* Normally we strip the effects of ALOGV (VERBOSE messages),
23
* LOG_FATAL and LOG_FATAL_IF (FATAL assert messages) from the
24
* release builds be defining NDEBUG. You can modify this (for
25
* example with "#define LOG_NDEBUG 0" at the top of your source
26
* file) to change that behavior.
37
/* --------------------------------------------------------------------- */
39
#ifndef __predict_false
40
#define __predict_false(exp) __builtin_expect((exp) != 0, 0)
44
* Simplified macro to send a verbose radio log message using current LOG_TAG.
47
#define __RLOGV(...) \
48
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, \
54
__RLOGV(__VA_ARGS__); \
58
#define RLOGV(...) __RLOGV(__VA_ARGS__)
64
#define RLOGV_IF(cond, ...) ((void)0)
66
#define RLOGV_IF(cond, ...) \
67
((__predict_false(cond)) \
68
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, \
69
LOG_TAG, __VA_ARGS__)) \
75
* Simplified macro to send a debug radio log message using current LOG_TAG.
79
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, \
84
#define RLOGD_IF(cond, ...) \
85
((__predict_false(cond)) \
86
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, \
87
LOG_TAG, __VA_ARGS__)) \
92
* Simplified macro to send an info radio log message using current LOG_TAG.
96
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, \
101
#define RLOGI_IF(cond, ...) \
102
((__predict_false(cond)) \
103
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, \
104
LOG_TAG, __VA_ARGS__)) \
109
* Simplified macro to send a warning radio log message using current LOG_TAG.
113
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, \
118
#define RLOGW_IF(cond, ...) \
119
((__predict_false(cond)) \
120
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, \
121
LOG_TAG, __VA_ARGS__)) \
126
* Simplified macro to send an error radio log message using current LOG_TAG.
130
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, \
135
#define RLOGE_IF(cond, ...) \
136
((__predict_false(cond)) \
137
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, \
138
LOG_TAG, __VA_ARGS__)) \