4 * Copyright 2012-2013 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 __PT_DEBUG_H__
21 #define __PT_DEBUG_H__
27 #define LOG_TAG "PRINT_SERVICE"
30 #define PT_VERBOSE(fmt, args...) \
32 #define PT_INFO(fmt, args...) \
34 #define PT_DEBUG(fmt, args...) \
36 #define PT_WARN(fmt, args...) \
38 #define PT_ERROR(fmt, args...) \
40 #define PT_FATAL(fmt, args...) \
43 #define PT_RET_IF(expr, fmt, args...) \
46 PT_DEBUG("[%s] Return, message "fmt, #expr, ##args );\
51 #define PT_RETV_IF(expr, val, fmt, args...) \
54 PT_DEBUG("[%s] Return value, message "fmt, #expr, ##args );\
59 #define PT_IF_FREE_MEM(mem) \
67 #define PRINT_SERVICE_FUNC_ENTER PT_INFO("ENTER FUNCTION: %s\n", __FUNCTION__);
68 #define PRINT_SERVICE_FUNC_LEAVE PT_INFO("EXIT FUNCTION: %s\n", __FUNCTION__);
70 #else /* PT_DLOG_OUT */
72 #define PT_PRT(prio, fmt, arg...) \
74 fprintf((prio ? stderr : stdout), "%s:%s(%d)>"fmt"\n", __FILE__, __func__, __LINE__, ##arg);\
77 #define PT_DEBUG(fmt, arg...) \
79 printf("%s:%s(%d)>"fmt"\n", __FILE__, __func__, __LINE__, ##arg); \
82 #define PRINT_SERVICE_FUNC_ENTER PT_PRT(0, "%s enter\n", __FUNCTION__);
83 #define PRINT_SERVICE_FUNC_LEAVE PT_PRT(0, "%s leave\n", __FUNCTION__);
85 #define PT_RET_IF(expr, fmt, args...) \
88 PT_DEBUG("[%s] Return, message "fmt, #expr, ##args );\
93 #define PT_RETV_IF(expr, val, fmt, args...) \
96 PT_DEBUG("[%s] Return value, message "fmt, #expr, ##args );\
101 #define PT_IF_FREE_MEM(mem) \
109 #endif /* PT_DLOG_OUT */
111 #endif /* __PT_DEBUG_H__ */