media/webrtc/signaling/src/common/browser_logging/CSFLog.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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 #ifndef CSFLOG_H
     6 #define CSFLOG_H
     8 // In order for FORCE_PR_LOG below to work, we have to define it before the
     9 // first time prlog is #included.
    10 #if defined(PR_LOG)
    11 #error "Must #include CSFLog.h before before any IPDL-generated files or other files that #include prlog.h."
    12 #endif
    14 #if defined(MOZ_LOGGING)
    15 #define FORCE_PR_LOG
    16 #endif
    18 #include <stdarg.h>
    19 #include "prlog.h"
    21 typedef enum{
    22     CSF_LOG_CRITICAL =1,
    23     CSF_LOG_ERROR,
    24     CSF_LOG_WARNING,
    25     CSF_LOG_NOTICE,
    26     CSF_LOG_INFO,
    27     CSF_LOG_DEBUG,
    28     CSF_LOG_OBNOXIOUS
    29 } CSFLogLevel;
    33 #define CSFLogError(tag , format, ...) CSFLog( CSF_LOG_ERROR, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ )
    34 #define CSFLogErrorV(tag , format, va_list_arg) CSFLogV(CSF_LOG_ERROR, __FILE__ , __LINE__ , tag , format , va_list_arg )
    35 #define CSFLogWarn(tag , format, ...) CSFLog( CSF_LOG_WARNING, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ )
    36 #define CSFLogWarnV(tag , format, va_list_arg) CSFLogV(CSF_LOG_WARNING, __FILE__ , __LINE__ , tag , format , va_list_arg )
    37 #define CSFLogNotice(tag , format, ...) CSFLog( CSF_LOG_NOTICE, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ )
    38 #define CSFLogNoticeV(tag , format, va_list_arg) CSFLogV(CSF_LOG_NOTICE, __FILE__ , __LINE__ , tag , format , va_list_arg )
    39 #define CSFLogInfo(tag , format, ...) CSFLog( CSF_LOG_INFO, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ )
    40 #define CSFLogInfoV(tag , format, va_list_arg) CSFLogV(CSF_LOG_INFO, __FILE__ , __LINE__ , tag , format , va_list_arg )
    41 #define CSFLogDebug(tag , format, ...) CSFLog(CSF_LOG_DEBUG, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ )
    42 #define CSFLogDebugV(tag , format, va_list_arg) CSFLogV(CSF_LOG_DEBUG, __FILE__ , __LINE__ , tag , format , va_list_arg )
    43 #define CSFLogObnoxious(tag , format, ...) CSFLog(CSF_LOG_OBNOXIOUS, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ )
    44 #define CSFLogObnoxiousV(tag , format, va_list_arg) CSFLogV(CSF_LOG_OBNOXIOUS, __FILE__ , __LINE__ , tag , format , va_list_arg )
    46 #ifdef __cplusplus
    47 extern "C"
    48 {
    49 #endif
    50 void CSFLog( CSFLogLevel priority, const char* sourceFile, int sourceLine, const char* tag , const char* format, ...)
    51 #ifdef __GNUC__
    52   __attribute__ ((format (printf, 5, 6)))
    53 #endif
    54 ;
    55 void CSFLogV( CSFLogLevel priority, const char* sourceFile, int sourceLine, const char* tag , const char* format, va_list args);
    57 PRLogModuleInfo *GetSignalingLogInfo();
    58 PRLogModuleInfo *GetWebRTCLogInfo();
    59 extern int gWebrtcTraceLoggingOn;
    61 #ifdef __cplusplus
    62 }
    63 #endif
    65 #endif

mercurial