Class RetainingLogHandler

java.lang.Object
ch.njol.skript.log.LogHandler
ch.njol.skript.log.RetainingLogHandler
All Implemented Interfaces:
OpenCloseable, Closeable, AutoCloseable

public class RetainingLogHandler extends LogHandler
  • Constructor Details

    • RetainingLogHandler

      public RetainingLogHandler()
  • Method Details

    • log

      public LogHandler.LogResult log(LogEntry entry)
      Specified by:
      log in class LogHandler
      Parameters:
      entry - entry to log
      Returns:
      Whether to print the specified entry or not.
    • onStop

      public void onStop()
      Description copied from class: LogHandler
      Called just after the handler is removed from the active handlers stack.
      Overrides:
      onStop in class LogHandler
    • start

      public RetainingLogHandler start()
      Description copied from class: LogHandler
      A convenience method for SkriptLogger.startLogHandler(LogHandler).
      Implementations should override this to set the return type to the implementing class.
      Overrides:
      start in class LogHandler
    • printErrors

      public final boolean printErrors()
    • printErrors

      public final boolean printErrors(@Nullable String def)
      Prints all retained errors or the given one if no errors were retained.

      This handler is stopped if not already done.

      Parameters:
      def - Error to print if no errors were logged, can be null to not print any error if there are none
      Returns:
      Whether there were any errors
    • printErrors

      public final boolean printErrors(@Nullable String def, ErrorQuality quality)
    • printErrors

      public final boolean printErrors(org.bukkit.command.CommandSender recipient, @Nullable String def)
      Sends all retained error messages to the given recipient.

      This handler is stopped if not already done.

      Parameters:
      recipient -
      def - Error to send if no errors were logged, can be null to not print any error if there are none
      Returns:
      Whether there were any errors to send
    • printLog

      public final void printLog()
      Prints all retained log messages.

      This handler is stopped if not already done.

    • hasErrors

      public boolean hasErrors()
    • getFirstError

      public @Nullable LogEntry getFirstError()
    • getFirstError

      public LogEntry getFirstError(String def)
    • clear

      public void clear()
      Clears the list of retained log messages.
    • size

      public int size()
    • getLog

      public Collection<LogEntry> getLog()
    • getErrors

      public Collection<LogEntry> getErrors()
    • getNumErrors

      public int getNumErrors()