Class JC4JLogger

java.lang.Object
com.github.nedelis.jc4j.logging.JC4JLogger

public class JC4JLogger extends Object
Custom logger of the library. This logger is wrapper for the System.out.println() function
See Also:
  • Constructor Details

  • Method Details

    • trace

      public void trace(String msg)
    • trace

      public void trace(String msg, Throwable t)
    • debug

      public void debug(String msg)
    • debug

      public void debug(String message, Throwable t)
    • info

      public void info(String msg)
    • info

      public void info(String msg, @NotNull @NotNull Throwable t)
    • warn

      public void warn(String msg)
    • warn

      public void warn(String msg, @NotNull @NotNull Throwable t)
    • error

      public void error(String msg)
    • error

      public void error(String msg, @NotNull @NotNull Throwable t)
    • fatal

      public void fatal(String msg)
      Prints the given message, stores it in the messages and shuts down the program
      Parameters:
      msg - message to be printed
    • fatal

      public void fatal(String msg, @NotNull @NotNull Throwable t)
      Do the same thing as fatal(String), but also prints the given throwable
      Parameters:
      t - throwable to be printed
      msg - message to be printed
    • doWithoutLogging

      public <R> R doWithoutLogging(@NotNull @NotNull NoParamsFunction<R> func)
      This function allows to do any other function without logging
      Type Parameters:
      R - type of the function's return value
      Parameters:
      func - returnable function without params
      Returns:
      result of the given function
    • doWithoutLogging

      public void doWithoutLogging(@NotNull @NotNull Procedure proc)
      This procedure allows to do any other procedure without logging
      Parameters:
      proc - procedure that will be executed
    • disable

      public void disable()
      Disables logger
    • enable

      public void enable()
      Enables logger
    • isEnabled

      public boolean isEnabled()
      Checks whether the logger is enabled or not
      Returns:
      true if the logger is enabled
    • name

      public String name()
      Returns:
      name of the logger
    • logLevel

      public int logLevel()
      Returns:
      level of the logger