4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: junsuk. oh <junsuk77.oh@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __PKGMGR_INFO_DEBUG_H__
23 #define __PKGMGR_INFO_DEBUG_H__
27 #define _LOGE(fmt, arg...) LOGE(fmt, ##arg)
28 #define _LOGD(fmt, arg...) LOGD(fmt, ##arg)
30 #define PKGMGR_INFO_ENABLE_DLOG
32 #define COLOR_RED "\033[0;31m"
33 #define COLOR_BLUE "\033[0;34m"
34 #define COLOR_END "\033[0;m"
36 #ifdef PKGMGR_INFO_ENABLE_DLOG
37 #define PKGMGR_INFO_DEBUG(fmt, ...)\
40 LOGD(fmt, ##__VA_ARGS__);\
43 #define PKGMGR_INFO_DEBUG_ERR(fmt, ...)\
46 LOGE(COLOR_RED fmt COLOR_END, ##__VA_ARGS__);\
49 #define PKGMGR_INFO_BEGIN() \
52 LOGD(COLOR_BLUE"BEGIN >>>>"COLOR_END);\
55 #define PKGMGR_INFO_END() \
58 LOGD(COLOR_BLUE"END <<<<"COLOR_END);\
63 #define PKGMGR_INFO_DEBUG(fmt, ...) \
66 printf("\n [%s: %s(): %d] " fmt"\n", rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
69 #define PKGMGR_INFO_BEGIN() \
72 printf("\n [%s: %d] : BEGIN >>>> %s() \n", rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__);\
75 #define PKGMGR_INFO_END() \
78 printf("\n [%s: %d]: END <<<< %s()\n", rindex(__FILE__, '/')+1, __LINE__ , __FUNCTION__); \
84 #define ret_if(expr) do { \
86 PKGMGR_INFO_DEBUG_ERR("(%s) ", #expr); \
91 #define retm_if(expr, fmt, arg...) do { \
93 PKGMGR_INFO_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
98 #define retv_if(expr, val) do { \
100 PKGMGR_INFO_DEBUG_ERR("(%s) ", #expr); \
105 #define retvm_if(expr, val, fmt, arg...) do { \
107 PKGMGR_INFO_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
112 #define tryvm_if(expr, val, fmt, arg...) do { \
114 PKGMGR_INFO_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
120 #endif /* __PKGMGR_INFO_DEBUG_H__ */