add subdir-objects option
[platform/core/multimedia/avsystem.git] / include / avsys-debug.h
1 /*
2  * avsystem
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22 /**
23  * This file defines the debug function of AV System.
24  *
25  * @file                avsys_debug.h
26  * @version     0.1
27  */
28
29 #ifndef __AVSYS_DEBUG_H__
30 #define __AVSYS_DEBUG_H__
31
32 #ifdef __USE_LOGMANAGER__
33 #include <stdio.h>
34 #include <mm_log.h>
35 #define AVAUDIO  LOG_AVSYSTEM
36 #else
37 #define AVAUDIO
38 #endif
39
40 #ifdef __DEBUG_MODE__
41 #ifdef __USE_LOGMANAGER__
42
43 #define avsys_info_r(owner, msg, args...)               log_print_rel( owner, LOG_CLASS_INFO, msg, ##args )
44 #define avsys_warning_r(owner, msg, args...)    log_print_rel( owner, LOG_CLASS_WARNING, msg, ##args )
45 #define avsys_error_r(owner, msg, args...)              log_print_rel( owner, LOG_CLASS_ERR, msg, ##args )
46 #define avsys_critical_r(owner, msg, args...)   log_print_rel( owner, LOG_CLASS_CRITICAL, msg, ##args )
47 #define avsys_assert_r(condition)                               log_assert_rel(( condition ))
48
49 #define avsys_info(owner, msg, args...)                 log_print_dbg( owner, LOG_CLASS_INFO, msg, ##args )
50 #define avsys_warning(owner, msg, args...)              log_print_dbg( owner, LOG_CLASS_WARNING, msg, ##args )
51 #define avsys_error(owner, msg, args...)                log_print_dbg( owner, LOG_CLASS_ERR, msg, ##args )
52 #define avsys_critical(owner, msg, args...)             log_print_dbg( owner, LOG_CLASS_CRITICAL, msg, ##args )
53 #define avsys_assert(condition)                                 log_assert_dbg( (condition) )
54
55 #else   /* __USE_LOGMANAGER__ */
56
57 #define avsys_info_r(owner, msg, args...)               fprintf(stderr, msg, ##args)
58 #define avsys_warning_r(owner, msg, args...)    fprintf(stderr, msg, ##args)
59 #define avsys_error_r(owner, msg, args...)              fprintf(stderr, msg, ##args)
60 #define avsys_critical_r(owner, msg, args...)   fprintf(stderr, msg, ##args)
61 #define avsys_assert_r(condition)                               (condition)
62
63 #define avsys_info(owner, msg, args...)                 fprintf(stderr, msg, ##args)
64 #define avsys_warning(owner, msg, args...)              fprintf(stderr, msg, ##args)
65 #define avsys_error(owner, msg, args...)                fprintf(stderr, msg, ##args)
66 #define avsys_critical(owner, msg, args...)             fprintf(stderr, msg, ##args)
67 #define avsys_assert(condition)                                 (condition)
68
69 #endif  /* __USE_LOGMANAGER__ */
70
71 #else   /* __DEBUG_MODE__ */
72
73 #define avsys_info_r(owner, msg, args...)
74 #define avsys_warning_r(owner, msg, args...)
75 #define avsys_error_r(owner, msg, args...)
76 #define avsys_critical_r(owner, msg, args...)
77 #define avsys_assert_r(condition)                               (condition)
78
79 #define avsys_info(owner, msg, args...)
80 #define avsys_warning(owner, msg, args...)
81 #define avsys_error(owner, msg, args...)
82 #define avsys_critical(owner, msg, args...)
83 #define avsys_assert(condition)                                 (condition)
84
85 #endif  /* __DEBUG_MODE__ */
86
87 #endif /* __AVSYS_DEBUG_H__ */