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.
30 #define LOG_TAG "GALLERY-EFL"
39 /* anci c color type */
40 #define FONT_COLOR_RESET "\033[0m"
41 #define FONT_COLOR_RED "\033[31m"
42 #define FONT_COLOR_GREEN "\033[32m"
43 #define FONT_COLOR_YELLOW "\033[33m"
44 #define FONT_COLOR_BLUE "\033[34m"
45 #define FONT_COLOR_PURPLE "\033[35m"
46 #define FONT_COLOR_CYAN "\033[36m"
47 #define FONT_COLOR_GRAY "\033[37m"
51 #endif // _USE_LOG_FILE_
55 #define ge_dbg(fmt,arg...) fprintf(g_log_fp, "[%s: %d]" fmt "\n", __FUNCTION__, __LINE__, ##arg)
57 #elif defined _USE_DLOG_
59 #define ge_dbg(fmt, arg...) LOGD("[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg)
60 #define ge_dbgW(fmt, arg...) LOGW(FONT_COLOR_GREEN"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg)
61 #define ge_dbgE(fmt, arg...) LOGE(FONT_COLOR_RED"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg)
63 #elif defined _USE_LOG_CONSOLE_
65 #define ge_dbg(fmt,arg...) fprintf(stdout, "[%s: %d] [%s]" fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg)
66 #define ge_dbgW(fmt, arg...) fprintf(stdout, "[%s : %d] [%s] " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg)
67 #define ge_dbgE(fmt, arg...) fprintf(stdout, "[%s : %d] [%s] " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg)
71 #define ge_dbg(fmt,arg...)
72 #define ge_dbgW(fmt, arg...)
73 #define ge_dbgE(fmt, arg...)
76 #define ge_warn_if(expr, fmt, arg...) do { \
78 ge_dbg("(%s) -> "fmt, #expr, ##arg); \
81 #define ge_ret_if(expr) do { \
83 ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
87 #define ge_retv_if(expr, val) do { \
89 ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
93 #define ge_retm_if(expr, fmt, arg...) do { \
95 ge_dbgE(fmt, ##arg); \
96 ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
100 #define ge_retvm_if(expr, val, fmt, arg...) do { \
102 ge_dbgE(fmt, ##arg); \
103 ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
109 #define GE_CHECK_VAL(expr, val) ge_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!")
110 #define GE_CHECK_NULL(expr) ge_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!")
111 #define GE_CHECK_FALSE(expr) ge_retvm_if(!(expr), false, "Invalid parameter, return FALSE!")
112 #define GE_CHECK_CANCEL(expr) ge_retvm_if(!(expr), ECORE_CALLBACK_CANCEL, "Invalid parameter, return ECORE_CALLBACK_CANCEL!")
113 #define GE_CHECK(expr) ge_retm_if(!(expr), "Invalid parameter, return!")
117 #include <sys/time.h>
119 void _ge_print_debug_time_ex(long start, long end, const char* func_name, char* time_string);
125 #endif /* _GL_DEBUG_H_ */