2 * Copyright 2012 Samsung Electronics Co., Ltd
\r
4 * Licensed under the Flora License, Version 1.1 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://floralicense.org/license/
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 #ifndef __gallery_debug_H__
\r
18 #define __gallery_debug_H__
\r
20 #define ENABLE_LOG_SYSTEM
\r
22 #ifdef ENABLE_LOG_SYSTEM
\r
23 #define USE_DLOG_SYSTEM
\r
25 #ifdef USE_DLOG_SYSTEM
\r
32 #define LOG_TAG "gallery-setting"
\r
34 #define gallery_debug(fmt, arg...) do{ \
\r
35 LOGD("[%s :%05d] "fmt "\n",__FUNCTION__, __LINE__,##arg); \
\r
37 #define gallery_info(fmt, arg...) do{ \
\r
38 LOGI("[%s :%05d] "fmt "\n",__FUNCTION__, __LINE__,##arg); \
\r
40 #define gallery_warn(fmt, arg...) do{ \
\r
41 LOGW("[%s :%05d] "fmt "\n",__FUNCTION__, __LINE__,##arg); \
\r
43 #define gallery_error(fmt, arg...) do{ \
\r
44 LOGE("[%s :%05d] "fmt "\n",__FUNCTION__, __LINE__,##arg); \
\r
47 #define gallery_func_enter() LOGD( "[%s: %05d] <<<< enter \n", __func__, __LINE__)
\r
48 #define gallery_func_leave() LOGD( "[%s: %05d] >>>> leave \n", __func__, __LINE__ )
\r
50 #else //USE_DLOG_SYSTEM
\r
51 #define gallery_debug(fmt, arg...) do { \
\r
52 fprintf(stderr,"[%s:%05d] " fmt "\n",__func__, __LINE__, ##arg); \
\r
55 #define gallery_info(fmt, arg...) do { \
\r
56 fprintf(stderr,"[%s:%05d] " fmt "\n",__func__, __LINE__, ##arg); \
\r
59 #define gallery_warn(fmt, arg...) do { \
\r
60 fprintf(stderr,"[%s:%05d] " fmt "\n",__func__, __LINE__, ##arg); \
\r
63 #define gallery_error(fmt, arg...) do { \
\r
64 fprintf(stderr,"[%s:%05d] " fmt "\n",__func__, __LINE__, ##arg); \
\r
66 #define gallery_func_enter() fprintf(stdout, "[%s : %05d] <<< enter \n", __func__, __LINE__ , ##arg)
\r
67 #define gallery_func_leave() fprintf(stdout, "[%s : %05d] >>> leave \n", __func__, __LINE__ , ##arg)
\r
69 #endif // #ifdef USE_DLOG_SYSTEM
\r
71 #else //ENABLE_LOG_SYSTEM
\r
72 #define gallery_debug(fmt, arg...)
\r
73 #define gallery_info(fmt, arg...)
\r
74 #define gallery_warn(fmt, arg...)
\r
75 #define gallery_error(fmt, arg...)
\r
76 #endif //ENABLE_LOG_SYSTEM
\r
79 #define gallery_ret_if(expr) do { \
\r
84 #define gallery_retv_if(expr, val) do { \
\r
90 #define gallery_retm_if(expr, fmt, arg...) do { \
\r
92 gallery_warn(fmt, ##arg); \
\r
97 #define gallery_retvm_if(expr, val, fmt, arg...) do { \
\r
99 gallery_warn(fmt, ##arg); \
\r
105 #endif //__gallery_debug_H__
\r