Class Logger

java.lang.Object
glair.vision.logger.Logger

public class Logger extends Object
A simple logger class for logging messages with various log levels and a customizable log pattern.
  • Method Details

    • getInstance

      public static Logger getInstance()
      Get the singleton instance of the logger.
      Returns:
      The logger instance.
    • getLogLevel

      public String getLogLevel()
      Get the current log level.
      Returns:
      The log level as a string.
    • setLogLevel

      public void setLogLevel(int logLevel)
      Set the log level.
      Parameters:
      logLevel - The log level to set. Possible values:
      - LoggerConfig.DEBUG for debugging messages.
      - LoggerConfig.INFO for informational messages.
      - LoggerConfig.WARN for warning messages.
      - LoggerConfig.ERROR for error messages.
    • getPattern

      public String getPattern()
      Get the log pattern.
      Returns:
      The log pattern.
    • setPattern

      public void setPattern(String pattern)
      Set the log pattern.
      Parameters:
      pattern - The log pattern to set.
    • debug

      public void debug(Object... args)
      Log a debug message.
      Parameters:
      args - The objects to log.
    • info

      public void info(Object... args)
      Log an info message.
      Parameters:
      args - The objects to log.
    • warn

      public void warn(Object... args)
      Log a warning message.
      Parameters:
      args - The objects to log.
    • error

      public void error(Object... args)
      Log an error message.
      Parameters:
      args - The objects to log.
    • toString

      public String toString()
      Get a string representation of the logger configuration.
      Overrides:
      toString in class Object
      Returns:
      A JSON-formatted string representing the logger configuration.
    • main

      public static void main(String[] args)
      Main method for testing the logger.
      Parameters:
      args - Command-line arguments (not used).