Class Logger

java.lang.Object
fr.sandro642.github.log.Logger

public class Logger extends Object
Logger is a utility class for logging messages in the ConnectLib library. It provides methods to log messages with different severity levels: INFO, WARN, ERROR, and CRITICAL. Use setShowLogs(true/false) to control console output. Logs are always saved to file regardless of the setting.
  • Constructor Details

    • Logger

      public Logger()
  • Method Details

    • showLogs

      public void showLogs()
      Enable console output for logs. Call this method once to display all logs in console. By default, logs are only saved to file without console output. Logs are always saved to file regardless of this setting.
    • INFO

      public void INFO(String msg)
      Method to display an informational message in the console. This method prints the message in green color if showLogs is enabled, and always logs it to file.
      Parameters:
      msg - The message to log
    • WARN

      public void WARN(String msg)
      Method to display a warning message in the console. This method prints the message in yellow color if showLogs is enabled, and always logs it to file.
      Parameters:
      msg - The message to log
    • ERROR

      public void ERROR(String msg)
      Method to display an error message in the console. This method prints the message in red color if showLogs is enabled, and always logs it to file.
      Parameters:
      msg - The message to log
    • CRITICAL

      public void CRITICAL(String msg)
      Method to display a critical message in the console. This method prints the message in magenta color if showLogs is enabled, and always logs it to file.
      Parameters:
      msg - The message to log