4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __PTS_DEBUG_H__
21 #define __PTS_DEBUG_H__
29 #define LOG_TAG "MOBILEPRINT"
32 #define PTS_VERBOSE(fmt, args...) \
34 #define PTS_INFO(fmt, args...) \
36 #define PTS_DEBUG(fmt, args...) \
38 #define PTS_WARN(fmt, args...) \
40 #define PTS_ERROR(fmt, args...) \
42 #define PTS_FATAL(fmt, args...) \
45 #define PTS_RET_IF(expr, fmt, args...) \
48 PTS_DEBUG("[%s] Return, message "fmt, #expr, ##args );\
53 #define PTS_RETV_IF(expr, val, fmt, args...) \
56 PTS_DEBUG("[%s] Return value, message "fmt, #expr, ##args );\
61 #define PTS_TRACE_BEGIN PTS_INFO("ENTER FUNCTION: %s\n", __FUNCTION__);
62 #define PTS_TRACE_END PTS_INFO("EXIT FUNCTION: %s\n", __FUNCTION__);
65 #define PTS_PRT(prio, fmt, arg...) \
66 do { fprintf((prio ? stderr : stdout), "%s:%s(%d)>"fmt"\n", __FILE__, __func__, __LINE__, ##arg); } while (0)
68 #define DBG(fmt, arg...) \
70 printf("%s:%s(%d)>"fmt"\n", __FILE__, __func__, __LINE__, ##arg); \
73 #define PTS_RET_IF(expr, fmt, args...) \
76 PTS_PRT("[%s] Return, message "fmt, #expr, ##args );\
81 #define PTS_RETV_IF(expr, val, fmt, args...) \
84 PTS_PRT("[%s] Return value, message "fmt, #expr, ##args );\
89 #define PTS_TRACE_BEGIN PTS_PRT(0, "%s enter\n", __FUNCTION__)
90 #define PTS_TRACE_END PTS_PRT(0, "%s leave\n", __FUNCTION__)
94 #define PTS_FILE_EXISTS(path) \
95 (path && (1 == ecore_file_exists(path)) && (ecore_file_size(path) > 0))
97 #define PTS_IF_DEL_TIMER(timer) \
100 ecore_timer_del(timer); \
105 #define PTS_IF_DEL_IDLER(idler) \
108 ecore_idler_del(idler); \
114 #define PTS_IF_DEL_OBJ(obj) \
117 evas_object_del(obj); \
122 #define PTS_IF_FREE_MEM(mem) \
132 #endif /* __PTS_DEBUG_H__ */