no bug - Correct some typos in the comments. a=typo-fix
[gecko.git] / third_party / sipcc / sdp_log.h
blob6aeb1215298f4350e4c263961dfd500f642b3d89
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* This is a mirror of CSFLog. The implementations of SDPLog, SDPLogV, and
6 SDPLogTestLevel must be provided by the user. */
8 #ifndef SDPLOG_H
9 #define SDPLOG_H
11 #include <stdarg.h>
13 typedef enum {
14 SDP_LOG_ERROR = 1,
15 SDP_LOG_WARNING,
16 SDP_LOG_INFO,
17 SDP_LOG_DEBUG,
18 SDP_LOG_VERBOSE,
19 } SDPLogLevel;
21 #define SDPLogError(tag, format, ...) \
22 SDPLog(SDP_LOG_ERROR, __FILE__, __LINE__, tag, format, ##__VA_ARGS__)
23 #define SDPLogErrorV(tag, format, va_list_arg) \
24 SDPLogV(SDP_LOG_ERROR, __FILE__, __LINE__, tag, format, va_list_arg)
25 #define SDPLogWarn(tag, format, ...) \
26 SDPLog(SDP_LOG_WARNING, __FILE__, __LINE__, tag, format, ##__VA_ARGS__)
27 #define SDPLogWarnV(tag, format, va_list_arg) \
28 SDPLogV(SDP_LOG_WARNING, __FILE__, __LINE__, tag, format, va_list_arg)
29 #define SDPLogInfo(tag, format, ...) \
30 SDPLog(SDP_LOG_INFO, __FILE__, __LINE__, tag, format, ##__VA_ARGS__)
31 #define SDPLogInfoV(tag, format, va_list_arg) \
32 SDPLogV(SDP_LOG_INFO, __FILE__, __LINE__, tag, format, va_list_arg)
33 #define SDPLogDebug(tag, format, ...) \
34 SDPLog(SDP_LOG_DEBUG, __FILE__, __LINE__, tag, format, ##__VA_ARGS__)
35 #define SDPLogDebugV(tag, format, va_list_arg) \
36 SDPLogV(SDP_LOG_DEBUG, __FILE__, __LINE__, tag, format, va_list_arg)
37 #define SDPLogVerbose(tag, format, ...) \
38 SDPLog(SDP_LOG_VERBOSE, __FILE__, __LINE__, tag, format, ##__VA_ARGS__)
39 #define SDPLogVerboseV(tag, format, va_list_arg) \
40 SDPLogV(SDP_LOG_VERBOSE, __FILE__, __LINE__, tag, format, va_list_arg)
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 void SDPLog(SDPLogLevel priority, const char* sourceFile, int sourceLine,
46 const char* tag, const char* format, ...)
48 #ifdef __GNUC__
49 __attribute__((format(printf, 5, 6)))
50 #endif
53 void SDPLogV(SDPLogLevel priority, const char* sourceFile, int sourceLine,
54 const char* tag, const char* format, va_list args);
56 int SDPLogTestLevel(SDPLogLevel priority);
58 #ifdef __cplusplus
60 #endif
62 #endif