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
Simple logger for metadata generator util.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
AbstractAutomaticBean.OutputStreamOptions -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanClose output stream in audit finished.private final PrintWriterWhere to write error messages.private final AuditEventFormatterFormatter for the log message. -
Constructor Summary
ConstructorsConstructorDescriptionMetadataGeneratorLogger(OutputStream outputStream, AbstractAutomaticBean.OutputStreamOptions outputStreamOptions) Creates a new MetadataGeneratorLogger instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(AuditEvent event) Notify that an audit error was discovered on a specific file.voidaddException(AuditEvent event, Throwable throwable) Notify that an exception happened while performing audit.voidauditFinished(AuditEvent event) Notify that the audit is finished.voidauditStarted(AuditEvent event) Notify that the audit is about to start.voidfileFinished(AuditEvent event) Notify that audit is finished on a specific file.voidfileStarted(AuditEvent event) Notify that audit is about to start on a specific file.protected voidProvides 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 Details
-
errorWriter
Where to write error messages. -
formatter
Formatter for the log message. -
closeErrorWriter
Close output stream in audit finished.
-
-
Constructor Details
-
MetadataGeneratorLogger
public MetadataGeneratorLogger(OutputStream outputStream, AbstractAutomaticBean.OutputStreamOptions outputStreamOptions) Creates a new MetadataGeneratorLogger instance.- Parameters:
outputStream- where to log audit eventsoutputStreamOptions- ifCLOSEerror should be closed in auditFinished()
-
-
Method Details
-
auditStarted
Description copied from interface:AuditListenerNotify that the audit is about to start.- Specified by:
auditStartedin interfaceAuditListener- Parameters:
event- the event details
-
auditFinished
Description copied from interface:AuditListenerNotify that the audit is finished.- Specified by:
auditFinishedin interfaceAuditListener- Parameters:
event- the event details
-
fileStarted
Description copied from interface:AuditListenerNotify that audit is about to start on a specific file.- Specified by:
fileStartedin interfaceAuditListener- Parameters:
event- the event details
-
fileFinished
Description copied from interface:AuditListenerNotify that audit is finished on a specific file.- Specified by:
fileFinishedin interfaceAuditListener- Parameters:
event- the event details
-
addError
Description copied from interface:AuditListenerNotify that an audit error was discovered on a specific file.- Specified by:
addErrorin interfaceAuditListener- Parameters:
event- the event details
-
addException
Description copied from interface:AuditListenerNotify that an exception happened while performing audit.- Specified by:
addExceptionin interfaceAuditListener- Parameters:
event- the event detailsthrowable- details of the exception
-
finishLocalSetup
Description copied from class:AbstractAutomaticBeanProvides 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:
finishLocalSetupin classAbstractAutomaticBean
-