Class FreedomLogger

java.lang.Object
me.totalfreedom.utils.logging.FreedomLogger
All Implemented Interfaces:
net.kyori.adventure.audience.Audience, net.kyori.adventure.pointer.Pointered

public class FreedomLogger extends Object implements net.kyori.adventure.audience.Audience
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(String message)
    This method allows you to log a debug message to the console.
    net.kyori.adventure.text.Component
    debug(Supplier<String> message)
    This method allows you to log a debug message to the console, while also returning a Component that could be used to message a player.
    debugComponent(Supplier<net.kyori.adventure.text.Component> component)
    This method allows you to log a debug component to the console, while also returning a String representation of the debug component.
    debugComponent(net.kyori.adventure.text.Component component)
    This method allows you to log a debug component to the console.
    void
    error(String message)
    This method logs an error message to the console.
    void
    This method allows you to log an exception directly to the console.
    net.kyori.adventure.text.Component
    error(Supplier<String> message)
    This method allows you to log an error message to the console, while also returning a Component that could be used to message a player.
    errorComponent(Supplier<net.kyori.adventure.text.Component> component)
    This method allows you to log an error component to the console, while also returning a String representation of the error component.
    errorComponent(net.kyori.adventure.text.Component component)
    This method logs an error component to the console.
    getLogger(String moduleName)
     
    void
    info(String message)
    This method allows you to log a message to the console.
    net.kyori.adventure.text.Component
    info(Supplier<String> message)
    This method allows you to log a message to the console, while also returning a Component that could be used to message a player.
    infoComponent(Supplier<net.kyori.adventure.text.Component> component)
    This method allows you to log a component to the console, while also returning a String representation of the component
    infoComponent(net.kyori.adventure.text.Component component)
    This method allows you to log a component to the console.
    void
    sendMessage(@NotNull net.kyori.adventure.chat.SignedMessage signedMessage, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
     
    void
    sendMessage(@NotNull net.kyori.adventure.text.Component message)
     
    void
    sendMessage(@NotNull net.kyori.adventure.text.ComponentLike message)
     
    void
    sendMessage(@NotNull net.kyori.adventure.text.ComponentLike message, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
     
    void
    sendMessage(@NotNull net.kyori.adventure.text.Component message, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
     
    void
    setDebugMode(boolean debug)
     
    void
    warn(String message)
    This method allows you to log a warning to the console.
    void
    warnComponent(net.kyori.adventure.text.Component component)
    This method allows you to log a warning to the console.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.kyori.adventure.audience.Audience

    clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound

    Methods inherited from interface net.kyori.adventure.pointer.Pointered

    get, getOrDefault, getOrDefaultFrom, pointers
  • Method Details

    • getLogger

      public static FreedomLogger getLogger(String moduleName)
    • setDebugMode

      public void setDebugMode(boolean debug)
    • info

      public net.kyori.adventure.text.Component info(Supplier<String> message)
      This method allows you to log a message to the console, while also returning a Component that could be used to message a player.
      Parameters:
      message - The message to send.
      Returns:
      A component representation of the message.
    • infoComponent

      public String infoComponent(Supplier<net.kyori.adventure.text.Component> component)
      This method allows you to log a component to the console, while also returning a String representation of the component
      Parameters:
      component - The component to send.
      Returns:
      A string representation of the message.
    • infoComponent

      public String infoComponent(net.kyori.adventure.text.Component component)
      This method allows you to log a component to the console.
      Parameters:
      component - The component to send.
      Returns:
      A plain text representation of the message
    • info

      public void info(String message)
      This method allows you to log a message to the console.
      Parameters:
      message - The message to send.
    • warn

      public void warn(String message)
      This method allows you to log a warning to the console.
      Parameters:
      message - The message to send.
    • warnComponent

      public void warnComponent(net.kyori.adventure.text.Component component)
      This method allows you to log a warning to the console.
      Parameters:
      component - The component to send.
    • error

      public void error(String message)
      This method logs an error message to the console. It is highly recommended to deconstruct the stack trace and pass it in a more readable format to this method.
      Parameters:
      message - The message to send.
    • error

      public void error(Throwable th)
      This method allows you to log an exception directly to the console.
      Parameters:
      th - The exception to log.
    • error

      public net.kyori.adventure.text.Component error(Supplier<String> message)
      This method allows you to log an error message to the console, while also returning a Component that could be used to message a player. It is highly recommended that you deconstruct and limit the stack trace before passing it to this method, if you are intending to use it for player communication.
      Parameters:
      message - The message to send.
      Returns:
      A component representation of the message.
    • errorComponent

      public String errorComponent(Supplier<net.kyori.adventure.text.Component> component)
      This method allows you to log an error component to the console, while also returning a String representation of the error component.
      Parameters:
      component - The component to send.
      Returns:
      A String representation of the component.
    • errorComponent

      public String errorComponent(net.kyori.adventure.text.Component component)
      This method logs an error component to the console.
      Parameters:
      component - The message to send.
    • debug

      public net.kyori.adventure.text.Component debug(Supplier<String> message)
      This method allows you to log a debug message to the console, while also returning a Component that could be used to message a player. This method will only log if debug mode is enabled. If debug mode is not enabled, this method will return an empty component.
      Parameters:
      message - The message to send.
      Returns:
      A component representation of the message.
    • debugComponent

      public String debugComponent(Supplier<net.kyori.adventure.text.Component> component)
      This method allows you to log a debug component to the console, while also returning a String representation of the debug component.
      Parameters:
      component - The component to send.
      Returns:
      A String representation of the message.
    • debugComponent

      public String debugComponent(net.kyori.adventure.text.Component component)
      This method allows you to log a debug component to the console. This method will only log if debug mode is enabled.
      Parameters:
      component - The component to send.
    • debug

      public void debug(String message)
      This method allows you to log a debug message to the console. This method will only log if debug mode is enabled.
      Parameters:
      message - The message to send.
    • sendMessage

      public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.ComponentLike message)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
    • sendMessage

      public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
    • sendMessage

      public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
    • sendMessage

      public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.ComponentLike message, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
    • sendMessage

      public void sendMessage(@NotNull @NotNull net.kyori.adventure.chat.SignedMessage signedMessage, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience