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.
17 #ifndef __KIES_DLOG_H__
18 #define __KIES_DLOG_H__
23 /**********************************************************************
24 ******************define, struct ,typedef, union, enum, global val *************************************
25 ***********************************************************************/
26 #define KIES_FUN_BEG() KIES_INFO("====>>>>fun=%s, BEGIN====>>>>", __FUNCTION__);
27 #define KIES_FUN_END() KIES_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__);
28 #define KIES_INFO(fmt, arg...) LOGD("[%s:%d] "fmt, __FILE__, __LINE__, ##arg);
29 #define KIES_ERR(fmt, arg...) LOGE(FONT_COLOR_RED"[%s:%d] "fmt FONT_COLOR_RESET, __FILE__, __LINE__, ##arg);
31 #define KIES_FUN_DEBUG_BEG() //KIES_INFO("====>>>>fun=%s, BEGIN====>>>>", __FUNCTION__);
32 #define KIES_FUN_DEBUG_END() //KIES_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__);
33 #define KIES_DEBUG_INFO(fmt, arg...) //KIES_INFO(fmt, ##arg)
34 #define KIES_DEBUG_INFO(fmt, arg...) //KIES_ERR(fmt, ##arg)
36 #define KIES_RET_IF(expr) \
40 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
45 #define KIES_RETV_IF(expr, val) \
50 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
54 #define KIES_RETE_IF(expr, errorId) \
58 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
62 #define KIES_RETEM_IF(expr, errorId, fmt, arg...) \
66 KIES_INFO_RED(fmt, ##arg); \
67 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
71 #define KIES_RETVE_IF(expr, val, errorId) \
76 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
80 #define KIES_RETM_IF(expr, fmt, arg...) \
84 KIES_INFO_RED(fmt, ##arg); \
85 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
89 #define KIES_RETVM_IF(expr, val, fmt, arg...) \
94 KIES_INFO_RED(fmt, ##arg); \
95 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
99 #define KIES_RETVME_IF(expr, val, errorId, fmt, arg...) \
104 KIES_INFO_RED(fmt, ##arg); \
105 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
109 /* anci c color type */
110 #define FONT_COLOR_RESET "\033[0m"
111 #define FONT_COLOR_RED "\033[31m"
112 #define FONT_COLOR_GREEN "\033[32m"
113 #define FONT_COLOR_YELLOW "\033[33m"
114 #define FONT_COLOR_BLUE "\033[34m"
115 #define FONT_COLOR_PURPLE "\033[35m"
116 #define FONT_COLOR_CYAN "\033[36m"
117 #define FONT_COLOR_GRAY "\033[37m"
119 #define KIES_INFO_RED(fmt, arg...) KIES_INFO(FONT_COLOR_RED fmt FONT_COLOR_RESET, ##arg)
120 #define KIES_INFO_GREEN(fmt, arg...) KIES_INFO(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)
121 #define KIES_INFO_YELLOW(fmt, arg...) KIES_INFO(FONT_COLOR_YELLOW fmt FONT_COLOR_RESET, ##arg)
122 #define KIES_INFO_BLUE(fmt, arg...) KIES_INFO(FONT_COLOR_BLUE fmt FONT_COLOR_RESET, ##arg)
123 #define KIES_INFO_PURPLE(fmt, arg...) KIES_INFO(FONT_COLOR_PURPLE fmt FONT_COLOR_RESET, ##arg)
124 #define KIES_INFO_GREEN(fmt, arg...) KIES_INFO(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)
125 #define KIES_INFO_CYAN(fmt, arg...) KIES_INFO(FONT_COLOR_CYAN fmt FONT_COLOR_RESET, ##arg)
126 #define KIES_INFO_GRAY(fmt, arg...) KIES_INFO(FONT_COLOR_GRAY fmt FONT_COLOR_RESET, ##arg)
128 #define KIES_INFO_WITH_COLOR(color, fmt, arg...) KIES_INFO(color fmt FONT_COLOR_RESET, ##arg)
130 #endif //__KIES_DLOG_H__