com.puppycrawl.tools.checkstyle
Class DefaultLogger

java.lang.Object
  |
  +--com.puppycrawl.tools.checkstyle.DefaultLogger
All Implemented Interfaces:
AuditListener, java.util.EventListener

public class DefaultLogger
extends java.lang.Object
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()
          Creates a new DefaultLogger instance.
DefaultLogger(java.io.OutputStream aOS)
          Creates a new DefaultLogger instance.
 
Method Summary
 void addError(AuditEvent aEvt)
          notify that an audit error was discovered on a specific file
 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
 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
 java.io.OutputStream getOutputStream()
           
 void setOutputStream(java.io.OutputStream aOS)
          Set a stream to write information to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLogger

public DefaultLogger()
Creates a new DefaultLogger instance.

DefaultLogger

public DefaultLogger(java.io.OutputStream aOS)
Creates a new DefaultLogger instance.
Parameters:
aOS - where to log
Method Detail

setOutputStream

public void setOutputStream(java.io.OutputStream aOS)
Description copied from interface: AuditListener
Set a stream to write information to.
Specified by:
setOutputStream in interface AuditListener
See Also:
AuditListener

getOutputStream

public java.io.OutputStream getOutputStream()
Specified by:
getOutputStream in interface AuditListener
See Also:
AuditListener

addError

public void addError(AuditEvent aEvt)
Description copied from interface: AuditListener
notify that an audit error was discovered on a specific file
Specified by:
addError in interface AuditListener
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
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
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
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
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
See Also:
AuditListener