4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@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.
24 #ifndef _MEDIA_SVC_DEBUG_H_
25 #define _MEDIA_SVC_DEBUG_H_
36 #define LOG_TAG "MEDIA_SERVICE"
38 #define FONT_COLOR_RESET "\033[0m"
39 #define FONT_COLOR_RED "\033[31m"
40 #define FONT_COLOR_GREEN "\033[32m"
41 #define FONT_COLOR_YELLOW "\033[33m"
42 #define FONT_COLOR_BLUE "\033[34m"
43 #define FONT_COLOR_PURPLE "\033[35m"
44 #define FONT_COLOR_CYAN "\033[36m"
45 #define FONT_COLOR_GRAY "\033[37m"
47 #define media_svc_debug(fmt, arg...) do { \
48 LOGD(FONT_COLOR_RESET""fmt"", ##arg); \
51 #define media_svc_error(fmt, arg...) do { \
52 LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
55 #define media_svc_debug_fenter() do { \
56 LOGD(FONT_COLOR_YELLOW"<ENTER>"FONT_COLOR_RESET); \
59 #define media_svc_debug_fleave() do { \
60 LOGD(FONT_COLOR_YELLOW"<LEAVE>"FONT_COLOR_RESET); \
63 #define media_svc_retm_if(expr, fmt, arg...) do { \
65 LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
69 #define media_svc_retv_if(expr, val) do { \
71 LOGE(FONT_COLOR_RED""FONT_COLOR_RESET); \
75 #define media_svc_retvm_if(expr, val, fmt, arg...) do { \
77 LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
82 #define media_svc_retv_del_if(expr, val, p_str) do { \
84 LOGE(FONT_COLOR_RED""FONT_COLOR_RESET); \
85 _media_svc_destroy_content_info(p_str); \
90 #define media_svc_sec_debug(fmt, arg...) do { \
91 SECURE_LOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg); \
94 #define media_svc_sec_warn(fmt, arg...) do { \
95 SECURE_LOGW(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
98 #define media_svc_sec_error(fmt, arg...) do { \
99 SECURE_LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
102 #define ERR_BUF_LENGHT 256
103 #define media_svc_stderror(fmt) do { \
104 char media_svc_stderror_buf[ERR_BUF_LENGHT] = {0,}; \
105 strerror_r(errno, media_svc_stderror_buf, ERR_BUF_LENGHT); \
106 LOGE(FONT_COLOR_RED""fmt" : standard error= [%s]", media_svc_stderror_buf); \
110 #ifdef _PERFORMANCE_CHECK_
112 mediainfo_get_debug_time(void);
114 mediainfo_reset_debug_time(void);
116 mediainfo_print_debug_time(char *time_string);
118 mediainfo_print_debug_time_ex(long start, long end, const char *func_name, char *time_string);
121 #endif /*_MEDIA_SVC_DEBUG_H_*/