Upgrade bluez5_37 :Merge the code from private
[platform/upstream/bluez.git] / android / hal-log.h
1 /*
2  * Copyright (C) 2013 Intel Corporation
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
18 #define LOG_TAG "BlueZ"
19
20 #ifdef __BIONIC__
21 #include <cutils/log.h>
22 #else
23 #include <stdio.h>
24 #define LOG_INFO " I"
25 #define LOG_WARN " W"
26 #define LOG_ERROR " E"
27 #define LOG_DEBUG " D"
28 #define ALOG(pri, tag, fmt, arg...) fprintf(stderr, tag pri": " fmt"\n", ##arg)
29 #endif
30
31 #define info(fmt, arg...) ALOG(LOG_INFO, LOG_TAG, fmt, ##arg)
32 #define warn(fmt, arg...) ALOG(LOG_WARN, LOG_TAG, fmt, ##arg)
33 #define error(fmt, arg...) ALOG(LOG_ERROR, LOG_TAG, fmt, ##arg)
34 #define DBG(fmt, arg...) ALOG(LOG_DEBUG, LOG_TAG, "%s:%s() "fmt, __FILE__, \
35                                                         __func__, ##arg)