Class LoggingManager

java.lang.Object
dev.majek.hexnicks.util.LoggingManager

public class LoggingManager extends Object
Manages plugin logging. This includes printing log message, saving to file, and uploading to pastes.dev.
  • Constructor Details

    • LoggingManager

      public LoggingManager(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @Nullable @Nullable File directory)
      Create a new logging manager.
      Parameters:
      plugin - the plugin for which logging will be managed
      directory - the directory to store logs in set this to null if log files shouldn't be kept
  • Method Details

    • log

      public void log(@NotNull @NotNull String message)
      Log a simple message.
      Parameters:
      message - the message
    • error

      public void error(@NotNull @NotNull String message)
      Log an error. This should be something severe.
      Parameters:
      message - the error message
    • error

      public void error(@NotNull @NotNull String message, @NotNull @NotNull Throwable throwable)
      Log an error and it's exception.
      Parameters:
      message - the error message
      throwable - the exception
    • debug

      public void debug(@NotNull @NotNull String message)
      Log a debug message. This will only log if debug is set to true.
      Parameters:
      message - the message
    • debug

      public void debug(@NotNull @NotNull String message, @NotNull @NotNull net.kyori.adventure.audience.Audience audience)
      Log a debug message and send it to a user. This will only log if debug is set to true.
      Parameters:
      message - the message
      audience - the user to send the message to
    • latestToPasteBin

      @NotNull public @NotNull String latestToPasteBin()
      Publish the latest log to pastes.dev.
      Returns:
      the link to the log on the site
    • latestLog

      @NotNull public @NotNull String latestLog()
      Get the latest log from the latest file.
      Returns:
      the latest log
    • latestLogFile

      public File latestLogFile()
      Get the latest log file being used.
      Returns:
      the latest log file
    • doDebug

      public boolean doDebug()
      Whether debugging message should be sent.
      Returns:
      debugging status
    • doDebug

      public void doDebug(boolean debug)
      Set whether to send debugging messages.
      Parameters:
      debug - debugging status