4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #ifndef _MEDIA_SVC_DEBUG_H_
23 #define _MEDIA_SVC_DEBUG_H_
32 #define LOG_TAG "MEDIA_SERVICE"
34 #define FONT_COLOR_RESET "\033[0m"
35 #define FONT_COLOR_RED "\033[31m"
36 #define FONT_COLOR_GREEN "\033[32m"
37 #define FONT_COLOR_YELLOW "\033[33m"
38 #define FONT_COLOR_BLUE "\033[34m"
39 #define FONT_COLOR_PURPLE "\033[35m"
40 #define FONT_COLOR_CYAN "\033[36m"
41 #define FONT_COLOR_GRAY "\033[37m"
43 #define media_svc_debug(fmt, arg...) do { \
44 LOGD(FONT_COLOR_RESET"" fmt "", ##arg); \
47 #define media_svc_error(fmt, arg...) do { \
48 LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
51 #define media_svc_debug_fenter() do { \
52 LOGD(FONT_COLOR_YELLOW"<ENTER>" FONT_COLOR_RESET); \
55 #define media_svc_debug_fleave() do { \
56 LOGD(FONT_COLOR_YELLOW"<LEAVE>" FONT_COLOR_RESET); \
59 #define media_svc_retm_if(expr, fmt, arg...) do { \
61 LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
65 #define media_svc_retv_if(expr, val) do { \
67 LOGE(FONT_COLOR_RED"" FONT_COLOR_RESET); \
71 #define media_svc_retvm_if(expr, val, fmt, arg...) do { \
73 LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
78 #define media_svc_retv_del_if(expr, val, p_str) do { \
80 LOGE(FONT_COLOR_RED"" FONT_COLOR_RESET); \
81 _media_svc_destroy_content_info(p_str); \
86 #define media_svc_sec_debug(fmt, arg...) do { \
87 SECURE_LOGI(FONT_COLOR_GREEN"" fmt "" FONT_COLOR_RESET, ##arg); \
90 #define media_svc_sec_warn(fmt, arg...) do { \
91 SECURE_LOGW(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
94 #define media_svc_sec_error(fmt, arg...) do { \
95 SECURE_LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \
98 #define ERR_BUF_LENGHT 256
99 #define media_svc_stderror(fmt) do { \
100 char media_svc_stderror_buf[ERR_BUF_LENGHT] = {0,}; \
101 strerror_r(errno, media_svc_stderror_buf, ERR_BUF_LENGHT); \
102 LOGE(FONT_COLOR_RED""fmt" : standard error= [%s]", media_svc_stderror_buf); \
105 #endif /*_MEDIA_SVC_DEBUG_H_*/