2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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.tizenopensource.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, ...)\
42 LOGD(fmt,##__VA_ARGS__);\
45 #define UG_NFC_SHARE_DEBUG_ERR(fmt, ...)\
48 LOGE(COLOR_RED fmt COLOR_END,##__VA_ARGS__);\
51 #define UG_NFC_SHARE_BEGIN() \
54 LOGD(COLOR_BLUE"BEGIN >>>>"COLOR_END);\
57 #define UG_NFC_SHARE_END() \
60 LOGD(COLOR_BLUE"END <<<<"COLOR_END);\
65 #define UG_NFC_SHARE_DEBUG(fmt, ...) \
68 printf("\n [%s: %s: %s(): %d] " fmt"\n", APPNAME, rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
71 #define UG_NFC_SHARE_BEGIN() \
74 printf("\n [%s: %s: %d] : BEGIN >>>> %s() \n", APPNAME, rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__);\
77 #define UG_NFC_SHARE_END() \
80 printf("\n [%s: %s: %d]: END <<<< %s()\n", APPNAME, rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__); \
86 #define ret_if(expr) do { \
88 UG_NFC_SHARE_DEBUG_ERR("(%s) ", #expr); \
93 #define retm_if(expr, fmt, arg...) do { \
95 UG_NFC_SHARE_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
100 #define retv_if(expr, val) do { \
102 UG_NFC_SHARE_DEBUG_ERR("(%s) ", #expr); \
107 #define retvm_if(expr, val, fmt, arg...) do { \
109 UG_NFC_SHARE_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
116 #endif /*__UG_NFC_SHARE_DEBUG_H__*/