2 * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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.
18 #ifndef __UG_NFC_SHARE_DEBUG_H__
19 #define __UG_NFC_SHARE_DEBUG_H__
21 #define COLOR_RED "\033[0;31m"
22 #define COLOR_GREEN "\033[0;32m"
23 #define COLOR_BROWN "\033[0;33m"
24 #define COLOR_BLUE "\033[0;34m"
25 #define COLOR_PURPLE "\033[0;35m"
26 #define COLOR_CYAN "\033[0;36m"
27 #define COLOR_LIGHTBLUE "\033[0;37m"
28 #define COLOR_END "\033[0;m"
34 #define LOG_TAG "UG_SHARE_NFC_EFL"
36 #define UG_NFC_SHARE_ENABLE_DLOG
38 #ifdef UG_NFC_SHARE_ENABLE_DLOG
39 #define UG_NFC_SHARE_DEBUG(fmt, ...)\
41 LOGD(COLOR_BROWN" " fmt COLOR_END,##__VA_ARGS__);\
43 #define UG_NFC_SHARE_DEBUG_ERR(fmt, ...)\
45 LOGE(COLOR_RED" " fmt COLOR_END,##__VA_ARGS__);\
47 #define UG_NFC_SHARE_BEGIN() \
49 LOGD(COLOR_BLUE"BEGIN >>>>"COLOR_END);\
51 #define UG_NFC_SHARE_END() \
53 LOGD(COLOR_BLUE"END <<<<"COLOR_END);\
56 #define UG_NFC_SHARE_DEBUG(fmt, ...) \
58 printf("\n [%s: %s: %s(): %d] " fmt"\n", APPNAME, rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
60 #define UG_NFC_SHARE_BEGIN() \
62 printf("\n [%s: %s: %d] : BEGIN >>>> %s() \n", APPNAME, rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__);\
64 #define UG_NFC_SHARE_END() \
66 printf("\n [%s: %s: %d]: END <<<< %s()\n", APPNAME, rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__); \
70 #define ret_if(expr) \
73 UG_NFC_SHARE_DEBUG_ERR("(%s) ", #expr); \
78 #define retm_if(expr, fmt, arg...) \
81 UG_NFC_SHARE_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
86 #define retv_if(expr, val) \
89 UG_NFC_SHARE_DEBUG_ERR("(%s) ", #expr); \
94 #define retvm_if(expr, val, fmt, arg...) \
97 UG_NFC_SHARE_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
103 #endif /*__UG_NFC_SHARE_DEBUG_H__*/