Package org.webrtc

Class Logging

java.lang.Object
org.webrtc.Logging

public class Logging extends Object
Java wrapper for WebRTC logging. Logging defaults to java.util.logging.Logger, but a custom logger implementing the Loggable interface can be injected along with a Severity. All subsequent log messages will then be redirected to the injected Loggable, except those with a severity lower than the specified severity, which will be discarded. It is also possible to switch to native logging (rtc::LogMessage) if one of the following static functions are called from the app: - Logging.enableLogThreads - Logging.enableLogTimeStamps - Logging.enableLogToDebugOutput The priority goes: 1. Injected loggable 2. Native logging 3. Fallback logging. Only one method will be used at a time. Injecting a Loggable or using any of the enable... methods requires that the native library is loaded, using PeerConnectionFactory.initialize.
  • Field Details

    • fallbackLogger

      private static final Logger fallbackLogger
    • loggingEnabled

      private static volatile boolean loggingEnabled
    • loggable

      @Nullable private static Loggable loggable
    • loggableSeverity

      private static Logging.Severity loggableSeverity
  • Constructor Details

    • Logging

      public Logging()
  • Method Details

    • createFallbackLogger

      private static Logger createFallbackLogger()
    • injectLoggable

      static void injectLoggable(Loggable injectedLoggable, Logging.Severity severity)
    • deleteInjectedLoggable

      static void deleteInjectedLoggable()
    • enableLogThreads

      public static void enableLogThreads()
    • enableLogTimeStamps

      public static void enableLogTimeStamps()
    • enableTracing

      @Deprecated public static void enableTracing(String path, EnumSet<Logging.TraceLevel> levels)
      Deprecated.
    • enableLogToDebugOutput

      public static void enableLogToDebugOutput(Logging.Severity severity)
    • log

      public static void log(Logging.Severity severity, String tag, String message)
    • d

      public static void d(String tag, String message)
    • e

      public static void e(String tag, String message)
    • w

      public static void w(String tag, String message)
    • e

      public static void e(String tag, String message, Throwable e)
    • w

      public static void w(String tag, String message, Throwable e)
    • v

      public static void v(String tag, String message)
    • getStackTraceString

      private static String getStackTraceString(Throwable e)
    • nativeEnableLogToDebugOutput

      private static void nativeEnableLogToDebugOutput(int nativeSeverity)
    • nativeEnableLogThreads

      private static void nativeEnableLogThreads()
    • nativeEnableLogTimeStamps

      private static void nativeEnableLogTimeStamps()
    • nativeLog

      private static void nativeLog(int severity, String tag, String message)