2 * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _DOWNLOAD_AGENT_DEBUG_H
18 #define _DOWNLOAD_AGENT_DEBUG_H
20 #include "download-agent-type.h"
27 #define COLOR_RED "\033[0;31m"
28 #define COLOR_GREEN "\033[0;32m"
29 #define COLOR_BROWN "\033[0;33m"
30 #define COLOR_LIGHTBLUE "\033[0;37m"
31 #define COLOR_END "\033[0;m"
42 #define LOG_TAG "DP_DA"
43 #define DA_LOGV(format, ...) ((void)0)//LOGD("[%d]:"format, syscall(__NR_gettid), ##__VA_ARGS__)
44 #define DA_LOGD(format, ...) LOGD(COLOR_LIGHTBLUE "[%d]:"format COLOR_END, syscall(__NR_gettid), ##__VA_ARGS__)
45 #define DA_LOGI(format, ...) LOGI(COLOR_BROWN "[%d]:"format COLOR_END, syscall(__NR_gettid), ##__VA_ARGS__)
46 #define DA_LOGE(format, ...) LOGE(COLOR_RED "[%d]:"format COLOR_END, syscall(__NR_gettid), ##__VA_ARGS__)
47 #define DA_SECURE_LOGD(format, ...) SECURE_LOGD(COLOR_GREEN format COLOR_END, ##__VA_ARGS__)
48 #define DA_SECURE_LOGI(format, ...) SECURE_LOGI(COLOR_GREEN format COLOR_END, ##__VA_ARGS__)
49 #define DA_SECURE_LOGE(format, ...) SECURE_LOGE(COLOR_GREEN format COLOR_END, ##__VA_ARGS__)
55 #define DA_LOGD(format, ...) do {\
56 fprintf(stderr, "[DA][%d][%s():%d] "format"\n",syscall(__NR_gettid), __FUNCTION__,__LINE__, ##__VA_ARGS__);\
58 #define DA_LOGE(format, ...) do {\
59 fprintf(stderr, "[DA][%d][ERR][%s():%d]\n",syscall(__NR_gettid), __FUNCTION__,__LINE__, ##__VA_ARGS__);\
61 #define DA_LOGV DA_LOGD
62 #define DA_LOGI DA_LOGD
63 #define DA_SECURE_LOGD(format, ...) ((void)0)
64 #define DA_SECURE_LOGI(format, ...) ((void)0)
65 #define DA_SECURE_LOGE(format, ...) ((void)0)
66 #endif /* _ENABLE_DLOG */
68 #endif /* DOWNLOAD_AGENT_DEBUG_H */