4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jonghyuk Choi <jhchoi.choi@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 the debug function of AV System.
29 #ifndef __AVSYS_DEBUG_H__
30 #define __AVSYS_DEBUG_H__
32 #ifdef __USE_LOGMANAGER__
35 #define AVAUDIO LOG_AVAUDIO
36 #define AVVIDEO LOG_AVVIDEO
37 #define AVCAMERA LOG_AVCAMERA
45 #ifdef __USE_LOGMANAGER__
47 #define avsys_info_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_INFO, "[%05d:%s] "msg, __LINE__, __func__, ##args )
48 #define avsys_warning_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_WARNING, "[%05d:%s] "msg, __LINE__, __func__, ##args )
49 #define avsys_error_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_ERR, "[%05d:%s] "msg, __LINE__, __func__, ##args )
50 #define avsys_critical_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_CRITICAL, "[%05d:%s] "msg, __LINE__, __func__, ##args )
51 #define avsys_assert_r(condition) log_assert_rel(( condition ))
53 #define avsys_info(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_INFO, "[%05d:%s] "msg, __LINE__, __func__, ##args )
54 #define avsys_warning(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_WARNING, "[%05d:%s] "msg, __LINE__, __func__, ##args )
55 #define avsys_error(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_ERR, "[%05d:%s] "msg, __LINE__, __func__, ##args )
56 #define avsys_critical(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_CRITICAL, "[%05d:%s] "msg, __LINE__, __func__, ##args )
57 #define avsys_assert(condition) log_assert_dbg( (condition) )
59 #else /* __USE_LOGMANAGER__ */
61 #define avsys_info_r(owner, msg, args...) fprintf(stderr, msg, ##args)
62 #define avsys_warning_r(owner, msg, args...) fprintf(stderr, msg, ##args)
63 #define avsys_error_r(owner, msg, args...) fprintf(stderr, msg, ##args)
64 #define avsys_critical_r(owner, msg, args...) fprintf(stderr, msg, ##args)
65 #define avsys_assert_r(condition) (condition)
67 #define avsys_info(owner, msg, args...) fprintf(stderr, msg, ##args)
68 #define avsys_warning(owner, msg, args...) fprintf(stderr, msg, ##args)
69 #define avsys_error(owner, msg, args...) fprintf(stderr, msg, ##args)
70 #define avsys_critical(owner, msg, args...) fprintf(stderr, msg, ##args)
71 #define avsys_assert(condition) (condition)
73 #endif /* __USE_LOGMANAGER__ */
75 #else /* __DEBUG_MODE__ */
77 #define avsys_info_r(owner, msg, args...)
78 #define avsys_warning_r(owner, msg, args...)
79 #define avsys_error_r(owner, msg, args...)
80 #define avsys_critical_r(owner, msg, args...)
81 #define avsys_assert_r(condition) (condition)
83 #define avsys_info(owner, msg, args...)
84 #define avsys_warning(owner, msg, args...)
85 #define avsys_error(owner, msg, args...)
86 #define avsys_critical(owner, msg, args...)
87 #define avsys_assert(condition) (condition)
89 #endif /* __DEBUG_MODE__ */
91 #endif /* __AVSYS_DEBUG_H__ */