Record Class SpongeLogProvider

java.lang.Object
java.lang.Record
net.tnemc.plugincore.sponge.impl.SpongeLogProvider
All Implemented Interfaces:
LogProvider

public record SpongeLogProvider(org.apache.logging.log4j.Logger logger) extends Record implements LogProvider
SpongeLogProvider
Since:
0.1.2.0
Author:
creatorfromhell
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpongeLogProvider(org.apache.logging.log4j.Logger logger)
    Creates an instance of a SpongeLogProvider record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(String message, DebugLevel level)
    Sends a message related to debug purposes.
    final boolean
    Indicates whether some other object is "equal to" this one.
    void
    error(String message, Exception exception, DebugLevel level)
    Sends an error-related message.
    void
    error(String message, DebugLevel level)
    Sends an error-related message.
    final int
    Returns a hash code value for this object.
    void
    inform(String message, DebugLevel level)
    Sends an informative message, which doesn't contain an error or debug message.
    org.apache.logging.log4j.Logger
    Returns the value of the logger record component.
    final String
    Returns a string representation of this record class.
    void
    warning(String message, DebugLevel level)
    Sends a warning message.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.tnemc.plugincore.core.compatibility.LogProvider

    debug, error, inform, sqlError, warning
  • Constructor Details

    • SpongeLogProvider

      public SpongeLogProvider(org.apache.logging.log4j.Logger logger)
      Creates an instance of a SpongeLogProvider record class.
      Parameters:
      logger - the value for the logger record component
  • Method Details

    • inform

      public void inform(String message, DebugLevel level)
      Sends an informative message, which doesn't contain an error or debug message.
      Specified by:
      inform in interface LogProvider
      Parameters:
      message - The message to send.
      level - The DebugLevel to log this message at.
    • debug

      public void debug(String message, DebugLevel level)
      Sends a message related to debug purposes.
      Specified by:
      debug in interface LogProvider
      Parameters:
      message - The message to send.
      level - The DebugLevel to log this message at.
    • warning

      public void warning(String message, DebugLevel level)
      Sends a warning message.
      Specified by:
      warning in interface LogProvider
      Parameters:
      message - The message to send.
      level - The DebugLevel to log this message at.
    • error

      public void error(String message, DebugLevel level)
      Sends an error-related message.
      Specified by:
      error in interface LogProvider
      Parameters:
      message - The message to send.
      level - The DebugLevel to log this message at.
    • error

      public void error(String message, Exception exception, DebugLevel level)
      Sends an error-related message.
      Specified by:
      error in interface LogProvider
      Parameters:
      message - The message to send.
      exception - The error's Exception.
      level - The DebugLevel to log this message at.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • logger

      public org.apache.logging.log4j.Logger logger()
      Returns the value of the logger record component.
      Returns:
      the value of the logger record component