2 ** Copyright 2008, 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.
23 #include <utils/Log.h>
25 #ifdef RPC_LOG_TO_STDOUT_ONLY
26 #define PRINT(x...) do { \
27 fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \
28 fprintf(stdout, ##x); \
30 #elif defined(RPC_LOG_TO_STDOUT_AND_LOG)
31 #define PRINT(x...) do { \
32 fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \
33 fprintf(stdout, ##x); \
37 #define PRINT(x...) LOGI(x)
43 #define D(x...) do { } while(0)
49 #define V(x...) do { } while(0)
52 #define E(x...) do { \
53 fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \
54 fprintf(stderr, ##x); \
58 #define FAILIF(cond, msg...) do { \
59 if (__builtin_expect (cond, 0)) { \
60 fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \
61 fprintf(stderr, ##msg); \