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.
23 * This file defines synchronize apis for phone explorer.
25 * @file media-svc-debug.h
26 * @author Hyunjun Ko <zzoon.ko@samsung.com>
28 * @brief This file defines in-house apis for media service.
34 * @defgroup MEDIA_SVC_DEBUG in-house media service API
40 #ifndef _MEDIA_SVC_DEBUG_H_
41 #define _MEDIA_SVC_DEBUG_H_
54 #define LOG_TAG "Media-SVC"
57 #define DEBUG_PREFIX "Media-SVC"
60 //#define MB_SVC_LOG_FILE "/opt/mb-svc.log"
70 #ifdef MB_SVC_LOG_FILE
71 #define pb_svc_debug(fmt, arg...) \
74 fp = fopen(MB_SVC_LOG_FILE, "a"); \
75 fprintf(fp, "[%s] ", DEBUG_PREFIX); \
76 fprintf(fp, fmt, ##arg); \
78 fprintf(stderr, "[%s] ", DEBUG_PREFIX); \
79 fprintf(stderr, fmt, ##arg); \
82 #else /*MB_SVC_LOG_FILE*/
83 #define mb_svc_debug(fmt, arg...) \
85 fprintf(stderr, "[%s] ", DEBUG_PREFIX); \
86 fprintf(stderr, fmt, ##arg); \
88 #endif /*MB_SVC_LOG_FILE*/
93 #include <asm/unistd.h>
95 static pid_t gettid(void)
97 return syscall(__NR_gettid);
100 #define mb_svc_debug(fmt, arg...) LOGD("[%d] [%s : %d] " fmt "\n", gettid(), __FUNCTION__, __LINE__, ##arg)
108 #define mb_svc_debug(fmt, arg...)
112 #endif /*_MEDIA_SVC_DEBUG_H_*/