resolved the code rule warnings
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / inc / bt-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 #ifndef _BT_HAL_LOG_H_
19 #define _BT_HAL_LOG_H_
20
21 #undef LOG_TAG
22 #define LOG_TAG "BLUETOOTH_HAL"
23
24 #ifdef FUNCTION_TRACE
25 #define FN_START BT_DBG("[ENTER FUNC]")
26 #define FN_END BT_DBG("[EXIT FUNC]")
27 #else
28 #define FN_START
29 #define FN_END
30 #endif
31
32 #define LOG_COLOR_RESET    "\033[0m"
33 #define LOG_COLOR_RED      "\033[31m"
34 #define LOG_COLOR_YELLOW   "\033[33m"
35 #define LOG_COLOR_GREEN         "\033[32m"
36 #define LOG_COLOR_BLUE          "\033[36m"
37 #define LOG_COLOR_PURPLE   "\033[35m"
38
39 #define DBG(fmt, args...) \
40         SLOGD(fmt, ##args)
41 #define INFO(fmt, args...) \
42         SLOGI(fmt, ##args)
43 #define ERR(fmt, args...) \
44         SLOGE(fmt, ##args)
45
46 #define INFO_C(fmt, arg...) \
47         SLOGI_IF(TRUE,  LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg)
48 #define ERR_C(fmt, arg...) \
49         SLOGI_IF(TRUE,  LOG_COLOR_RED" "fmt" "LOG_COLOR_RESET, ##arg)
50
51 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
52 #define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args)
53
54 #endif //_BT_HAL_LOG_H_