Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant
Class DefaultLogger

    java.lang.Object
      |
      +--org.apache.tools.ant.DefaultLogger

All Implemented Interfaces:
  BuildListener, BuildLogger, java.util.EventListener

Direct Known Subclasses:
  NoBannerLogger

public class DefaultLogger
extends java.lang.Object
implements BuildLogger

Writes build event to a PrintStream. Currently, it only writes which targets are being executed, and any messages that get logged.

Field Summary
`protected boolean` | `emacsMode`
`protected java.io.PrintStream` | `err`
`protected static java.lang.String` | `lSep`
`protected int` | `msgOutputLevel`
`protected java.io.PrintStream` | `out`

Constructor Summary
`DefaultLogger()`

Method Summary
`void` | `buildFinished(BuildEvent event)` Prints whether the build succeeded or failed, and any errors the occured during the build.
`void` | `buildStarted(BuildEvent event)` Fired before any targets are started.
`protected static java.lang.String` | `formatTime(long millis)`
`void` | `messageLogged(BuildEvent event)` Fired whenever a message is logged.
`void` | `setEmacsMode(boolean emacsMode)` Set this logger to produce emacs (and other editor) friendly output.
`void` | `setErrorPrintStream(java.io.PrintStream err)` Set the output stream to which this logger is to send error messages.
`void` | `setMessageOutputLevel(int level)` Set the msgOutputLevel this logger is to respond to.
`void` | `setOutputPrintStream(java.io.PrintStream output)` Set the output stream to which this logger is to send its output.
`void` | `targetFinished(BuildEvent event)` Fired when a target has finished.
`void` | `targetStarted(BuildEvent event)` Fired when a target is started.
`void` | `taskFinished(BuildEvent event)` Fired when a task has finished.
`void` | `taskStarted(BuildEvent event)` Fired when a task is started.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### out

    protected java.io.PrintStream out

### err

    protected java.io.PrintStream err

### msgOutputLevel

    protected int msgOutputLevel

### lSep

    protected static java.lang.String lSep

### emacsMode

    protected boolean emacsMode

Constructor Detail

### DefaultLogger

    public DefaultLogger()

Method Detail

### setMessageOutputLevel

    public void setMessageOutputLevel(int level)

  Set the msgOutputLevel this logger is to respond to. Only messages with a message level lower than or equal to the given level are output to the log.

  Constants for the message levels are in Project.java. The order of the levels, from least to most verbose, is MSG_ERR, MSG_WARN, MSG_INFO, MSG_VERBOSE, MSG_DEBUG. The default message level for DefaultLogger is Project.MSG_ERR.

  Specified by:
    `setMessageOutputLevel` in interface `BuildLogger`
  Parameters:
    `level` - the logging level for the logger.

### setOutputPrintStream

    public void setOutputPrintStream(java.io.PrintStream output)

  Set the output stream to which this logger is to send its output.
  Specified by:
    `setOutputPrintStream` in interface `BuildLogger`
  Parameters:
    `output` - the output stream for the logger.

### setErrorPrintStream

    public void setErrorPrintStream(java.io.PrintStream err)

  Set the output stream to which this logger is to send error messages.
  Specified by:
    `setErrorPrintStream` in interface `BuildLogger`
  Parameters:
    `err` - the error stream for the logger.

### setEmacsMode

    public void setEmacsMode(boolean emacsMode)

  Set this logger to produce emacs (and other editor) friendly output.
  Specified by:
    `setEmacsMode` in interface `BuildLogger`
  Parameters:
    `emacsMode` - true if output is to be unadorned so that emacs and other editors can parse files names, etc.

### buildStarted

    public void buildStarted(BuildEvent event)

  Description copied from interface: `BuildListener`
  Fired before any targets are started.
  Specified by:
    `buildStarted` in interface `BuildListener`

### buildFinished

    public void buildFinished(BuildEvent event)

  Prints whether the build succeeded or failed, and any errors the occured during the build.
  Specified by:
    `buildFinished` in interface `BuildListener`
  Following copied from interface: `org.apache.tools.ant.BuildListener`
  See Also:
    `BuildEvent.getException()`

### targetStarted

    public void targetStarted(BuildEvent event)

  Description copied from interface: `BuildListener`
  Fired when a target is started.
  Specified by:
    `targetStarted` in interface `BuildListener`
  Following copied from interface: `org.apache.tools.ant.BuildListener`
  See Also:
    `BuildEvent.getTarget()`

### targetFinished

    public void targetFinished(BuildEvent event)

  Description copied from interface: `BuildListener`
  Fired when a target has finished. This event will still be thrown if an error occured during the build.
  Specified by:
    `targetFinished` in interface `BuildListener`
  Following copied from interface: `org.apache.tools.ant.BuildListener`
  See Also:
    `BuildEvent.getException()`

### taskStarted

    public void taskStarted(BuildEvent event)

  Description copied from interface: `BuildListener`
  Fired when a task is started.
  Specified by:
    `taskStarted` in interface `BuildListener`
  Following copied from interface: `org.apache.tools.ant.BuildListener`
  See Also:
    `BuildEvent.getTask()`

### taskFinished

    public void taskFinished(BuildEvent event)

  Description copied from interface: `BuildListener`
  Fired when a task has finished. This event will still be throw if an error occured during the build.
  Specified by:
    `taskFinished` in interface `BuildListener`
  Following copied from interface: `org.apache.tools.ant.BuildListener`
  See Also:
    `BuildEvent.getException()`

### messageLogged

    public void messageLogged(BuildEvent event)

  Description copied from interface: `BuildListener`
  Fired whenever a message is logged.
  Specified by:
    `messageLogged` in interface `BuildListener`
  Following copied from interface: `org.apache.tools.ant.BuildListener`
  See Also:
    `BuildEvent.getMessage()`, `BuildEvent.getPriority()`

### formatTime

    protected static java.lang.String formatTime(long millis)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache Software Foundation. All Rights Reserved.