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

## com.puppycrawl.tools.checkstyle
Class DefaultLogger

    java.lang.Object
      com.puppycrawl.tools.checkstyle.api.AutomaticBean
          com.puppycrawl.tools.checkstyle.DefaultLogger

All Implemented Interfaces:
  AuditListener, Configurable, Contextualizable, java.util.EventListener

public class DefaultLogger
extends AutomaticBean
implements AuditListener

Simple plain logger for text output. This is maybe not very suitable for a text output into a file since it does not need all 'audit finished' and so on stuff, but it looks good on stdout anyway. If there is really a problem this is what XMLLogger is for. It gives structure.

Author:
  Stephane Bailliez
See Also:
  `XMLLogger`

Constructor Summary
`DefaultLogger(java.io.OutputStream aOS, boolean aCloseStreamsAfterUse)` Creates a new `DefaultLogger` instance.
`DefaultLogger(java.io.OutputStream aInfoStream, boolean aCloseInfoAfterUse, java.io.OutputStream aErrorStream, boolean aCloseErrorAfterUse)` Creates a new `DefaultLogger` instance.

Method Summary
`void` | `addError(AuditEvent aEvt)` Print an Emacs compliant line on the error stream.
`void` | `addException(AuditEvent aEvt, java.lang.Throwable aThrowable)` Notify that an exception happened while performing audit.
`void` | `auditFinished(AuditEvent aEvt)` Notify that the audit is finished.
`void` | `auditStarted(AuditEvent aEvt)` Notify that the audit is about to start.
`protected void` | `closeStreams()` Flushes the output streams and closes them if needed.
`void` | `fileFinished(AuditEvent aEvt)` Notify that audit is finished on a specific file.
`void` | `fileStarted(AuditEvent aEvt)` Notify that audit is about to start on a specific file.

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
`configure, contextualize, finishLocalSetup, getConfiguration, setupChild`

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

Constructor Detail

### DefaultLogger

    public DefaultLogger(java.io.OutputStream aOS,
                         boolean aCloseStreamsAfterUse)

  Creates a new `DefaultLogger` instance.

Parameters:
  `aOS` - where to log infos and errors
  `aCloseStreamsAfterUse` - if aOS should be closed in auditFinished()

### DefaultLogger

    public DefaultLogger(java.io.OutputStream aInfoStream,
                         boolean aCloseInfoAfterUse,
                         java.io.OutputStream aErrorStream,
                         boolean aCloseErrorAfterUse)

  Creates a new `DefaultLogger` instance.

Parameters:
  `aInfoStream` - the `OutputStream` for info messages
  `aCloseInfoAfterUse` - auditFinished should close aInfoStream
  `aErrorStream` - the `OutputStream` for error messages
  `aCloseErrorAfterUse` - auditFinished should close aErrorStream

Method Detail

### addError

    public void addError(AuditEvent aEvt)

  Print an Emacs compliant line on the error stream. If the column number is non zero, then also display it.

  Specified by:
    `addError` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### addException

    public void addException(AuditEvent aEvt,
                             java.lang.Throwable aThrowable)

  Description copied from interface: `AuditListener`
  Notify that an exception happened while performing audit.

  Specified by:
    `addException` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
    `aThrowable` - details of the exception
  See Also:
    `AuditListener`

### auditStarted

    public void auditStarted(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that the audit is about to start.

  Specified by:
    `auditStarted` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### fileFinished

    public void fileFinished(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that audit is finished on a specific file.

  Specified by:
    `fileFinished` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### fileStarted

    public void fileStarted(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that audit is about to start on a specific file.

  Specified by:
    `fileStarted` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### auditFinished

    public void auditFinished(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that the audit is finished.

  Specified by:
    `auditFinished` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### closeStreams

    protected void closeStreams()

  Flushes the output streams and closes them if needed.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Back to the Checkstyle Home Page
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD