Package 

Class BacktraceLogger


  • 
    public class BacktraceLogger
    
                        

    A global logging utility for the Backtrace library.

    {@code BacktraceLogger} acts as a wrapper around a Logger implementation, providing a centralized logging mechanism throughout the library. By default, it uses the BacktraceInternalLogger, which relies on {@code android.util.Log} for logging. However, the logger can be replaced with a custom implementation by using the setLogger method.

    This allows for flexibility in logging strategies, enabling developers to integrate their preferred logging framework or customize log handling as needed.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Logger logger
    • Method Summary

      Modifier and Type Method Description
      static Logger getLogger()
      static void setLogger(@NotNull() Logger logger)
      static int d(String tag, String message)
      static int w(String tag, String message) Log messages that suggest something unexpected or rare has happened, which isn't an error.
      static int e(String tag, String message) Log messages that suggest error or something that should not happen
      static int e(String tag, String message, Throwable tr) Log messages that suggest error or something that should not happen
      static void setLevel(@NotNull() LogLevel level) Set logging level from which all messages should be logged to the console
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • d

         static int d(String tag, String message)
        Parameters:
        tag - source of logs, usually identifies the class or activity
        message - text information which should be logged
      • w

         static int w(String tag, String message)

        Log messages that suggest something unexpected or rare has happened, which isn't an error.

        Parameters:
        tag - source of logs, usually identifies the class or activity
        message - text information which should be logged
      • e

         static int e(String tag, String message)

        Log messages that suggest error or something that should not happen

        Parameters:
        tag - source of logs, usually identifies the class or activity
        message - text information which should be logged
      • e

         static int e(String tag, String message, Throwable tr)

        Log messages that suggest error or something that should not happen

        Parameters:
        tag - source of logs, usually identifies the class or activity
        message - text information which should be logged
        tr - an exception to log
      • setLevel

        @Deprecated() static void setLevel(@NotNull() LogLevel level)

        Set logging level from which all messages should be logged to the console

        Parameters:
        level - login level (debug, warn, error, off)