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_
34 #define LOG_TAG "MEDIA_SERVICE"
36 #define FONT_COLOR_RESET "\033[0m"
37 #define FONT_COLOR_RED "\033[31m"
38 #define FONT_COLOR_GREEN "\033[32m"
39 #define FONT_COLOR_YELLOW "\033[33m"
40 #define FONT_COLOR_BLUE "\033[34m"
41 #define FONT_COLOR_PURPLE "\033[35m"
42 #define FONT_COLOR_CYAN "\033[36m"
43 #define FONT_COLOR_GRAY "\033[37m"
45 #define media_svc_debug(fmt, arg...) do { \
46 LOGD(FONT_COLOR_RESET"" fmt "", ##arg); \
49 #define media_svc_error(fmt, arg...) do { \
50 LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
53 #define media_svc_debug_fenter() do { \
54 LOGD(FONT_COLOR_YELLOW"<ENTER>" FONT_COLOR_RESET); \
57 #define media_svc_debug_fleave() do { \
58 LOGD(FONT_COLOR_YELLOW"<LEAVE>" FONT_COLOR_RESET); \
61 #define media_svc_retm_if(expr, fmt, arg...) do { \
63 LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
67 #define media_svc_retv_if(expr, val) do { \
69 LOGE(FONT_COLOR_RED"" FONT_COLOR_RESET); \
73 #define media_svc_retvm_if(expr, val, fmt, arg...) do { \
75 LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
80 #define media_svc_retv_del_if(expr, val, p_str) do { \
82 LOGE(FONT_COLOR_RED"" FONT_COLOR_RESET); \
83 _media_svc_destroy_content_info(p_str); \
88 #define media_svc_sec_debug(fmt, arg...) do { \
89 SECURE_LOGI(FONT_COLOR_GREEN"" fmt "" FONT_COLOR_RESET, ##arg); \
92 #define media_svc_sec_warn(fmt, arg...) do { \
93 SECURE_LOGW(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
96 #define media_svc_sec_error(fmt, arg...) do { \
97 SECURE_LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
100 #define ERR_BUF_LENGHT 256
101 #define media_svc_stderror(fmt) do { \
102 char media_svc_stderror_buf[ERR_BUF_LENGHT] = {0,}; \
103 strerror_r(errno, media_svc_stderror_buf, ERR_BUF_LENGHT); \
104 LOGE(FONT_COLOR_RED""fmt" : standard error= [%s]", media_svc_stderror_buf); \
107 #endif /*_MEDIA_SVC_DEBUG_H_*/