3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.1 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #ifndef __KIES_DLOG_H__
19 #define __KIES_DLOG_H__
24 /**********************************************************************
25 ******************define, struct ,typedef, union, enum, global val *************************************
26 ***********************************************************************/
27 #define KIES_FUN_BEG() KIES_INFO("====>>>>fun=%s, BEGIN====>>>>", __FUNCTION__);
28 #define KIES_FUN_END() KIES_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__);
29 #define KIES_INFO(fmt, arg...) LOGD("[%s:%d] "fmt, __FILE__, __LINE__, ##arg);
30 #define KIES_ERR(fmt, arg...) LOGE(FONT_COLOR_RED"[%s:%d] "fmt FONT_COLOR_RESET, __FILE__, __LINE__, ##arg);
32 #define KIES_FUN_DEBUG_BEG() //KIES_INFO("====>>>>fun=%s, BEGIN====>>>>", __FUNCTION__);
33 #define KIES_FUN_DEBUG_END() //KIES_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__);
34 #define KIES_DEBUG_INFO(fmt, arg...) //KIES_INFO(fmt, ##arg)
35 #define KIES_DEBUG_INFO(fmt, arg...) //KIES_ERR(fmt, ##arg)
37 #define KIES_RET_IF(expr) \
41 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
46 #define KIES_RETV_IF(expr, val) \
51 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
55 #define KIES_RETE_IF(expr, errorId) \
59 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
63 #define KIES_RETEM_IF(expr, errorId, fmt, arg...) \
67 KIES_INFO_RED(fmt, ##arg); \
68 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
72 #define KIES_RETVE_IF(expr, val, errorId) \
77 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
81 #define KIES_RETM_IF(expr, fmt, arg...) \
85 KIES_INFO_RED(fmt, ##arg); \
86 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
90 #define KIES_RETVM_IF(expr, val, fmt, arg...) \
95 KIES_INFO_RED(fmt, ##arg); \
96 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
100 #define KIES_RETVME_IF(expr, val, errorId, fmt, arg...) \
105 KIES_INFO_RED(fmt, ##arg); \
106 KIES_INFO_RED("!!!!!!!!!!!!!!!!!!!! CHECK nErr=%d!!!!!!! \n(%s)return!!!!!!!!!!!\n\n", nErr, #expr); \
110 /* anci c color type */
111 #define FONT_COLOR_RESET "\033[0m"
112 #define FONT_COLOR_RED "\033[31m"
113 #define FONT_COLOR_GREEN "\033[32m"
114 #define FONT_COLOR_YELLOW "\033[33m"
115 #define FONT_COLOR_BLUE "\033[34m"
116 #define FONT_COLOR_PURPLE "\033[35m"
117 #define FONT_COLOR_CYAN "\033[36m"
118 #define FONT_COLOR_GRAY "\033[37m"
120 #define KIES_INFO_RED(fmt, arg...) KIES_INFO(FONT_COLOR_RED fmt FONT_COLOR_RESET, ##arg)
121 #define KIES_INFO_GREEN(fmt, arg...) KIES_INFO(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)
122 #define KIES_INFO_YELLOW(fmt, arg...) KIES_INFO(FONT_COLOR_YELLOW fmt FONT_COLOR_RESET, ##arg)
123 #define KIES_INFO_BLUE(fmt, arg...) KIES_INFO(FONT_COLOR_BLUE fmt FONT_COLOR_RESET, ##arg)
124 #define KIES_INFO_PURPLE(fmt, arg...) KIES_INFO(FONT_COLOR_PURPLE fmt FONT_COLOR_RESET, ##arg)
125 #define KIES_INFO_GREEN(fmt, arg...) KIES_INFO(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)
126 #define KIES_INFO_CYAN(fmt, arg...) KIES_INFO(FONT_COLOR_CYAN fmt FONT_COLOR_RESET, ##arg)
127 #define KIES_INFO_GRAY(fmt, arg...) KIES_INFO(FONT_COLOR_GRAY fmt FONT_COLOR_RESET, ##arg)
129 #define KIES_INFO_WITH_COLOR(color, fmt, arg...) KIES_INFO(color fmt FONT_COLOR_RESET, ##arg)
131 #endif //__KIES_DLOG_H__