Package io.sentry

Class DiagnosticLogger

  • All Implemented Interfaces:
    ILogger

    @Internal
    public final class DiagnosticLogger
    extends java.lang.Object
    implements ILogger
    Sentry SDK internal diagnostic logger.
    • Constructor Summary

      Constructors 
      Constructor Description
      DiagnosticLogger​(@NotNull SentryOptions options, @Nullable ILogger logger)
      Creates a new instance of DiagnosticLogger with the wrapped ILogger.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable ILogger getLogger()  
      boolean isEnabled​(@Nullable SentryLevel level)
      Whether this logger is enabled for the specified SentryLevel.
      void log​(@NotNull SentryLevel level, @NotNull java.lang.String message, @Nullable java.lang.Object... args)
      Logs a message with the specified level, message and optional arguments.
      void log​(@NotNull SentryLevel level, @NotNull java.lang.String message, @Nullable java.lang.Throwable throwable)
      Logs a message with the specified level, message and throwable.
      void log​(@NotNull SentryLevel level, @Nullable java.lang.Throwable throwable, @NotNull java.lang.String message, @Nullable java.lang.Object... args)
      Logs a message with the specified level, throwable, message and optional arguments.
      • Methods inherited from class java.lang.Object

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

      • DiagnosticLogger

        public DiagnosticLogger​(@NotNull
                                @NotNull SentryOptions options,
                                @Nullable
                                @Nullable ILogger logger)
        Creates a new instance of DiagnosticLogger with the wrapped ILogger.
        Parameters:
        options - a SentryOptions instance
        logger - a ILogger instance
    • Method Detail

      • isEnabled

        public boolean isEnabled​(@Nullable
                                 @Nullable SentryLevel level)
        Whether this logger is enabled for the specified SentryLevel.
        Specified by:
        isEnabled in interface ILogger
        Parameters:
        level - The SentryLevel to test against.
        Returns:
        True if a log message would be recorded for the level. Otherwise false.
      • log

        public void log​(@NotNull
                        @NotNull SentryLevel level,
                        @NotNull
                        @NotNull java.lang.String message,
                        @Nullable
                        @Nullable java.lang.Object... args)
        Logs a message with the specified level, message and optional arguments.
        Specified by:
        log in interface ILogger
        Parameters:
        level - The SentryLevel.
        message - The message.
        args - The optional arguments to format the message.
      • log

        public void log​(@NotNull
                        @NotNull SentryLevel level,
                        @NotNull
                        @NotNull java.lang.String message,
                        @Nullable
                        @Nullable java.lang.Throwable throwable)
        Logs a message with the specified level, message and throwable.
        Specified by:
        log in interface ILogger
        Parameters:
        level - The SentryLevel.
        message - The message.
        throwable - The throwable to log.
      • log

        public void log​(@NotNull
                        @NotNull SentryLevel level,
                        @Nullable
                        @Nullable java.lang.Throwable throwable,
                        @NotNull
                        @NotNull java.lang.String message,
                        @Nullable
                        @Nullable java.lang.Object... args)
        Logs a message with the specified level, throwable, message and optional arguments.
        Specified by:
        log in interface ILogger
        Parameters:
        level - The SentryLevel.
        throwable - The throwable to log.
        message - The message.
        args - The optional arguments to format the message.
      • getLogger

        @TestOnly
        @Nullable
        public @Nullable ILogger getLogger()