Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef CSFLOG_H |
michael@0 | 6 | #define CSFLOG_H |
michael@0 | 7 | |
michael@0 | 8 | // In order for FORCE_PR_LOG below to work, we have to define it before the |
michael@0 | 9 | // first time prlog is #included. |
michael@0 | 10 | #if defined(PR_LOG) |
michael@0 | 11 | #error "Must #include CSFLog.h before before any IPDL-generated files or other files that #include prlog.h." |
michael@0 | 12 | #endif |
michael@0 | 13 | |
michael@0 | 14 | #if defined(MOZ_LOGGING) |
michael@0 | 15 | #define FORCE_PR_LOG |
michael@0 | 16 | #endif |
michael@0 | 17 | |
michael@0 | 18 | #include <stdarg.h> |
michael@0 | 19 | #include "prlog.h" |
michael@0 | 20 | |
michael@0 | 21 | typedef enum{ |
michael@0 | 22 | CSF_LOG_CRITICAL =1, |
michael@0 | 23 | CSF_LOG_ERROR, |
michael@0 | 24 | CSF_LOG_WARNING, |
michael@0 | 25 | CSF_LOG_NOTICE, |
michael@0 | 26 | CSF_LOG_INFO, |
michael@0 | 27 | CSF_LOG_DEBUG, |
michael@0 | 28 | CSF_LOG_OBNOXIOUS |
michael@0 | 29 | } CSFLogLevel; |
michael@0 | 30 | |
michael@0 | 31 | |
michael@0 | 32 | |
michael@0 | 33 | #define CSFLogError(tag , format, ...) CSFLog( CSF_LOG_ERROR, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) |
michael@0 | 34 | #define CSFLogErrorV(tag , format, va_list_arg) CSFLogV(CSF_LOG_ERROR, __FILE__ , __LINE__ , tag , format , va_list_arg ) |
michael@0 | 35 | #define CSFLogWarn(tag , format, ...) CSFLog( CSF_LOG_WARNING, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) |
michael@0 | 36 | #define CSFLogWarnV(tag , format, va_list_arg) CSFLogV(CSF_LOG_WARNING, __FILE__ , __LINE__ , tag , format , va_list_arg ) |
michael@0 | 37 | #define CSFLogNotice(tag , format, ...) CSFLog( CSF_LOG_NOTICE, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) |
michael@0 | 38 | #define CSFLogNoticeV(tag , format, va_list_arg) CSFLogV(CSF_LOG_NOTICE, __FILE__ , __LINE__ , tag , format , va_list_arg ) |
michael@0 | 39 | #define CSFLogInfo(tag , format, ...) CSFLog( CSF_LOG_INFO, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) |
michael@0 | 40 | #define CSFLogInfoV(tag , format, va_list_arg) CSFLogV(CSF_LOG_INFO, __FILE__ , __LINE__ , tag , format , va_list_arg ) |
michael@0 | 41 | #define CSFLogDebug(tag , format, ...) CSFLog(CSF_LOG_DEBUG, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) |
michael@0 | 42 | #define CSFLogDebugV(tag , format, va_list_arg) CSFLogV(CSF_LOG_DEBUG, __FILE__ , __LINE__ , tag , format , va_list_arg ) |
michael@0 | 43 | #define CSFLogObnoxious(tag , format, ...) CSFLog(CSF_LOG_OBNOXIOUS, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) |
michael@0 | 44 | #define CSFLogObnoxiousV(tag , format, va_list_arg) CSFLogV(CSF_LOG_OBNOXIOUS, __FILE__ , __LINE__ , tag , format , va_list_arg ) |
michael@0 | 45 | |
michael@0 | 46 | #ifdef __cplusplus |
michael@0 | 47 | extern "C" |
michael@0 | 48 | { |
michael@0 | 49 | #endif |
michael@0 | 50 | void CSFLog( CSFLogLevel priority, const char* sourceFile, int sourceLine, const char* tag , const char* format, ...) |
michael@0 | 51 | #ifdef __GNUC__ |
michael@0 | 52 | __attribute__ ((format (printf, 5, 6))) |
michael@0 | 53 | #endif |
michael@0 | 54 | ; |
michael@0 | 55 | void CSFLogV( CSFLogLevel priority, const char* sourceFile, int sourceLine, const char* tag , const char* format, va_list args); |
michael@0 | 56 | |
michael@0 | 57 | PRLogModuleInfo *GetSignalingLogInfo(); |
michael@0 | 58 | PRLogModuleInfo *GetWebRTCLogInfo(); |
michael@0 | 59 | extern int gWebrtcTraceLoggingOn; |
michael@0 | 60 | |
michael@0 | 61 | #ifdef __cplusplus |
michael@0 | 62 | } |
michael@0 | 63 | #endif |
michael@0 | 64 | |
michael@0 | 65 | #endif |