4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hakjoo Ko <hakjoo.ko@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 __DB_UTIL_DEBUG_H_
23 #define __DB_UTIL_DEBUG_H_
26 #ifdef DB_UTIL_USING_PLATFORM_DBG
31 #define LOG_TAG "DBUTIL"
34 #ifdef DB_UTIL_ENABLE_TRACE
36 #ifdef DB_UTIL_USING_PLATFORM_DBG
38 #define DB_UTIL_TRACE_DEBUG LOGD
39 #define DB_UTIL_TRACE_WARNING LOGW
40 #define DB_UTIL_TRACE_ERROR LOGE
44 #define DB_UTIL_TRACE_DEBUG(fmt, arg...) \
46 fprintf(stderr,"[DBUTIL]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", ##arg, strrchr(__FILE__, '/')+1, __LINE__);\
49 #define DB_UTIL_TRACE_WARNING(fmt, arg...) \
51 fprintf(stderr,"[DBUTIL]\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, strrchr(__FILE__, '/')+1, __LINE__);\
54 #define DB_UTIL_TRACE_ERROR(fmt, arg...) \
56 fprintf(stderr, "[DBUTIL]\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, strrchr(__FILE__, '/')+1, __LINE__);\
63 #define DB_UTIL_TRACE_DEBUG(fmt, arg...)
64 #define DB_UTIL_TRACE_WARNING(fmt, arg...)
65 #define DB_UTIL_TRACE_ERROR(fmt, arg...)
68 #endif /* __DB_UTIL_DEBUG_H_ */