Package io.sentry

Class DiagnosticLogger

java.lang.Object
io.sentry.DiagnosticLogger
All Implemented Interfaces:
ILogger

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

    • 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 Details

    • 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 String message, @Nullable @Nullable 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 String message, @Nullable @Nullable 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 Throwable throwable, @NotNull @NotNull String message, @Nullable @Nullable 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()