Package org.codehaus.groovy.tools.shell.util

# Class Logger

java.lang.Object
org.codehaus.groovy.tools.shell.util.Logger

public final class Logger extends Object
Provides a very, very basic logging API.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static IO`
  `io`
  Shared shell I/O used to emit log messages.
  `final String`
  `name`
  Logger name shown in rendered log messages.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Logger`
  `create(Class type)`
  Creates a logger named after the supplied type.
  `static Logger`
  `create(Class type, String suffix)`
  Creates a logger named after the supplied type plus a suffix.
  `void`
  `debug(Object msg)`
  Logs a debug message when debug output is enabled.
  `void`
  `debug(Object msg, Throwable cause)`
  Logs a debug message and cause when debug output is enabled.
  `void`
  `error(Object msg)`
  Logs an error message.
  `void`
  `error(Object msg, Throwable cause)`
  Logs an error message and cause.
  `boolean`
  `isDebug()`
  Alias for `isDebugEnabled()`.
  `boolean`
  `isDebugEnabled()`
  Returns whether debug-level logging is currently enabled.
  `void`
  `warn(Object msg)`
  Logs a warning message.
  `void`
  `warn(Object msg, Throwable cause)`
  Logs a warning message and cause.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### io

    public static volatile IO io
    Shared shell I/O used to emit log messages.

  - ### name

    public final String name
    Logger name shown in rendered log messages.

- ## Method Details

  - ### isDebugEnabled

    public boolean isDebugEnabled()
    Returns whether debug-level logging is currently enabled.
    Returns:
      `true` if debug messages should be emitted

  - ### isDebug

    public boolean isDebug()
    Alias for `isDebugEnabled()`.
    Returns:
      `true` if debug messages should be emitted

  - ### debug

    public void debug(Object msg)
    Logs a debug message when debug output is enabled.
    Parameters:
      `msg` - the message to log

  - ### debug

    public void debug(Object msg, Throwable cause)
    Logs a debug message and cause when debug output is enabled.
    Parameters:
      `msg` - the message to log
      `cause` - the associated cause

  - ### warn

    public void warn(Object msg)
    Logs a warning message.
    Parameters:
      `msg` - the message to log

  - ### warn

    public void warn(Object msg, Throwable cause)
    Logs a warning message and cause.
    Parameters:
      `msg` - the message to log
      `cause` - the associated cause

  - ### error

    public void error(Object msg)
    Logs an error message.
    Parameters:
      `msg` - the message to log

  - ### error

    public void error(Object msg, Throwable cause)
    Logs an error message and cause.
    Parameters:
      `msg` - the message to log
      `cause` - the associated cause

  - ### create

    public static Logger create(Class type)
    Creates a logger named after the supplied type.
    Parameters:
      `type` - the type whose name should be used
    Returns:
      a logger for the type

  - ### create

    public static Logger create(Class type, String suffix)
    Creates a logger named after the supplied type plus a suffix.
    Parameters:
      `type` - the base type whose name should be used
      `suffix` - the suffix to append
    Returns:
      a logger for the type and suffix