Class Logger

java.lang.Object
org.ek9lang.core.Logger

public class Logger extends Object
Wrapper for logging.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    debug(Object content)
    Conditionally output debug information to stderr.
    static void
    debugf(String format, Object... args)
    Conditionally output debug information to stderr, using printf format.
    static void
    enableDebug(boolean enabled)
    enable of disable debug output.
    static void
    error(Object content)
    Log an error unless muting is enabled.
    static void
    error(Throwable throwable)
    Log a throwable stack trace unless muting is enabled.
    static void
    log(String content)
    Logs output to stdout.
    static void
    setMuteStderrOutput(boolean muteStderrOutput)
    Mute stderr output, but default the Logger uses stderr to report errors.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • enableDebug

      public static void enableDebug(boolean enabled)
      enable of disable debug output.
      Parameters:
      enabled - by default Logger disabled debug output.
    • setMuteStderrOutput

      public static void setMuteStderrOutput(boolean muteStderrOutput)
      Mute stderr output, but default the Logger uses stderr to report errors.
      Parameters:
      muteStderrOutput - by default Logger does not mute stderr, (for tests it is handy to switch off).
    • debug

      public static void debug(Object content)
      Conditionally output debug information to stderr.
    • log

      public static void log(String content)
      Logs output to stdout.
    • debugf

      public static void debugf(String format, Object... args)
      Conditionally output debug information to stderr, using printf format.
    • error

      public static void error(Object content)
      Log an error unless muting is enabled.
      Parameters:
      content - The content to log to stderr.
    • error

      public static void error(Throwable throwable)
      Log a throwable stack trace unless muting is enabled.
      Parameters:
      throwable - The throwable and its stack to log to stderr.