Package com.puppycrawl.tools.checkstyle
Class MetadataGeneratorLogger
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
-
- com.puppycrawl.tools.checkstyle.MetadataGeneratorLogger
-
- All Implemented Interfaces:
AuditListener
,Configurable
,Contextualizable
,EventListener
public class MetadataGeneratorLogger extends AbstractAutomaticBean implements AuditListener
Simple logger for metadata generator util.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
AbstractAutomaticBean.OutputStreamOptions
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
closeErrorWriter
Close output stream in audit finished.private PrintWriter
errorWriter
Where to write error messages.private AuditEventFormatter
formatter
Formatter for the log message.
-
Constructor Summary
Constructors Constructor Description MetadataGeneratorLogger(OutputStream outputStream, AbstractAutomaticBean.OutputStreamOptions outputStreamOptions)
Creates a new MetadataGeneratorLogger instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(AuditEvent event)
Notify that an audit error was discovered on a specific file.void
addException(AuditEvent event, Throwable throwable)
Notify that an exception happened while performing audit.void
auditFinished(AuditEvent event)
Notify that the audit is finished.void
auditStarted(AuditEvent event)
Notify that the audit is about to start.void
fileFinished(AuditEvent event)
Notify that audit is finished on a specific file.void
fileStarted(AuditEvent event)
Notify that audit is about to start on a specific file.protected void
finishLocalSetup()
Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.-
Methods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Field Detail
-
errorWriter
private final PrintWriter errorWriter
Where to write error messages.
-
formatter
private final AuditEventFormatter formatter
Formatter for the log message.
-
closeErrorWriter
private final boolean closeErrorWriter
Close output stream in audit finished.
-
-
Constructor Detail
-
MetadataGeneratorLogger
public MetadataGeneratorLogger(OutputStream outputStream, AbstractAutomaticBean.OutputStreamOptions outputStreamOptions)
Creates a new MetadataGeneratorLogger instance.- Parameters:
outputStream
- where to log audit eventsoutputStreamOptions
- ifCLOSE
error should be closed in auditFinished()
-
-
Method Detail
-
auditStarted
public void auditStarted(AuditEvent event)
Description copied from interface:AuditListener
Notify that the audit is about to start.- Specified by:
auditStarted
in interfaceAuditListener
- Parameters:
event
- the event details
-
auditFinished
public void auditFinished(AuditEvent event)
Description copied from interface:AuditListener
Notify that the audit is finished.- Specified by:
auditFinished
in interfaceAuditListener
- Parameters:
event
- the event details
-
fileStarted
public void fileStarted(AuditEvent event)
Description copied from interface:AuditListener
Notify that audit is about to start on a specific file.- Specified by:
fileStarted
in interfaceAuditListener
- Parameters:
event
- the event details
-
fileFinished
public void fileFinished(AuditEvent event)
Description copied from interface:AuditListener
Notify that audit is finished on a specific file.- Specified by:
fileFinished
in interfaceAuditListener
- Parameters:
event
- the event details
-
addError
public void addError(AuditEvent event)
Description copied from interface:AuditListener
Notify that an audit error was discovered on a specific file.- Specified by:
addError
in interfaceAuditListener
- Parameters:
event
- the event details
-
addException
public void addException(AuditEvent event, Throwable throwable)
Description copied from interface:AuditListener
Notify that an exception happened while performing audit.- Specified by:
addException
in interfaceAuditListener
- Parameters:
event
- the event detailsthrowable
- details of the exception
-
finishLocalSetup
protected void finishLocalSetup()
Description copied from class:AbstractAutomaticBean
Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.The default implementation does nothing.
- Specified by:
finishLocalSetup
in classAbstractAutomaticBean
-
-