Class Logger

java.lang.Object
com.chrisnewland.freelogj.Logger

public class Logger extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getLogger

      public static Logger getLogger(Class<?> clazz)
      Returns a Logger for the given Class. The fully qualified class name is printed on each log line.
      Parameters:
      clazz - The class to be logged
    • getLogger

      public static Logger getLogger(Class<?> clazz, Logger.LogLevel logLevel)
      Returns a Logger for the given Class and LogLevel. The fully qualified class name is printed on each log line.
      Parameters:
      clazz - The class to be logged
    • getLogger

      public static Logger getLogger(Class<?> clazz, Logger.LogLevel logLevel, PrintStream printStream)
      Returns a Logger for the given Class and LogLevel and PrintStream. The fully qualified class name is printed on each log line.
      Parameters:
      clazz - The class to be logged
    • getLogger

      public static Logger getLogger(Class<?> clazz, Logger.LogLevel logLevel, DateTimeFormatter dateFormat, PrintStream printStream)
      Returns a Logger for the given Class, LogLevel, DateTimeFormatter, and PrintStream. The fully qualified class name is printed on each log line.
      Parameters:
      clazz - The class to be logged
    • isTraceEnabled

      public boolean isTraceEnabled()
      Returns:
      true if the TRACE Logger.LogLevel is enabled.
    • isDebugEnabled

      public boolean isDebugEnabled()
      Returns:
      true if the DEBUG Logger.LogLevel is enabled.
    • isInfoEnabled

      public boolean isInfoEnabled()
      Returns:
      true if the INFO Logger.LogLevel is enabled.
    • isWarnEnabled

      public boolean isWarnEnabled()
      Returns:
      true if the WARN Logger.LogLevel is enabled.
    • isErrorEnabled

      public boolean isErrorEnabled()
      Returns:
      true if the ERROR Logger.LogLevel is enabled.
    • isFatalEnabled

      public boolean isFatalEnabled()
      Returns:
      true if the FATAL Logger.LogLevel is enabled.
    • trace

      public void trace(String message, Object... args)
      Output a message at the TRACE Logger.LogLevel.
      Parameters:
      message - The message to output.
      args - Arguments to be substituted for {} in the message String.
    • debug

      public void debug(String message, Object... args)
      Output a message at the DEBUG Logger.LogLevel.
      Parameters:
      message - The message to output.
      args - Arguments to be substituted for {} in the message String.
    • info

      public void info(String message, Object... args)
      Output a message at the INFO Logger.LogLevel.
      Parameters:
      message - The message to output.
      args - Arguments to be substituted for {} in the message String.
    • warn

      public void warn(String message, Object... args)
      Output a message at the WARN Logger.LogLevel.
      Parameters:
      message - The message to output.
      args - Arguments to be substituted for {} in the message String.
    • error

      public void error(String message, Object... args)
      Output a message at the ERROR Logger.LogLevel.
      Parameters:
      message - The message to output.
      args - Arguments to be substituted for {} in the message String.
    • fatal

      public void fatal(String message, Object... args)
      Output a message at the FATAL Logger.LogLevel.
      Parameters:
      message - The message to output.
      args - Arguments to be substituted for {} in the message String.
    • log

      private void log(Logger.LogLevel logLevel, String message, Object... args)