Class LogCatLogger

  • All Implemented Interfaces:
    com.pspdfkit.utils.PdfLog.Logger

    
    public class LogCatLogger
     implements PdfLog.Logger
                        

    Logger that logs all messages to LogCat.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      LogCatLogger()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean isLogged(int priority, @NonNull() String tag) Override this method to enable or disable logging for log with given priority and tag.
      void log(int priority, @NonNull() String tag, @NonNull() String message, @Nullable() Throwable throwable) Implement this method to log messages.
      void setEnabled(boolean isEnabled) Sets whether this logger is enabled.
      • Methods inherited from class java.lang.Object

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

      • LogCatLogger

        LogCatLogger()
    • Method Detail

      • isLogged

         boolean isLogged(int priority, @NonNull() String tag)

        Override this method to enable or disable logging for log with given priority and tag. By default all log requests are handled.

        Parameters:
        priority - The priority of this log message.
        tag - Tag to identify the source of this log message.
      • log

         void log(int priority, @NonNull() String tag, @NonNull() String message, @Nullable() Throwable throwable)

        Implement this method to log messages.

        Parameters:
        priority - The priority of this log message.
        tag - Tag to identify the source of this log message.
        message - Message that should be logged.
        throwable - Optional throwable attached to log message.
      • setEnabled

         void setEnabled(boolean isEnabled)

        Sets whether this logger is enabled. If enabled, all logs are printed to LogCat. If disabled, all logs are ignored.

        Parameters:
        isEnabled - Prints all logs to LogCat if true, ignores all logs when false.