java.lang.Object
io.github.lucfr1746.llibrary.util.helper.Logger

public class Logger extends Object
A custom logger utility for Minecraft plugins using the Spigot API. This class allows for standardized logging with support for different log levels and console messages with color formatting.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Logger(String pluginName)
    Constructs a Logger by looking up a plugin by its name.
    Logger(org.bukkit.plugin.Plugin plugin)
    Constructs a Logger associated with a given plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(String message)
    Sends a debug message to the console with blue formatting.
    void
    error(String message)
    Logs an error message.
    void
    info(String message)
    Logs an informational message.
    void
    success(String message)
    Sends a success message to the console with green formatting.
    void
    warning(String message)
    Logs a warning message.

    Methods inherited from class java.lang.Object

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

    • Logger

      public Logger(org.bukkit.plugin.Plugin plugin)
      Constructs a Logger associated with a given plugin.
      Parameters:
      plugin - The plugin instance this logger is bound to.
    • Logger

      public Logger(String pluginName)
      Constructs a Logger by looking up a plugin by its name.
      Parameters:
      pluginName - The name of the plugin.
      Throws:
      IllegalArgumentException - if the plugin cannot be found.
  • Method Details

    • info

      public void info(String message)
      Logs an informational message.
      Parameters:
      message - The message to log at INFO level.
    • warning

      public void warning(String message)
      Logs a warning message.
      Parameters:
      message - The message to log at WARNING level.
    • error

      public void error(String message)
      Logs an error message.
      Parameters:
      message - The message to log at SEVERE level.
    • success

      public void success(String message)
      Sends a success message to the console with green formatting.
      Parameters:
      message - The message to display as a success.
    • debug

      public void debug(String message)
      Sends a debug message to the console with blue formatting.
      Parameters:
      message - The message to display for debugging purposes.