Package org.apache.fop.events
Class LoggingEventListener
- java.lang.Object
-
- org.apache.fop.events.LoggingEventListener
-
- All Implemented Interfaces:
java.util.EventListener,EventListener
public class LoggingEventListener extends java.lang.Object implements EventListener
EventListener implementation that redirects events to Commons Logging. The events are converted to localized messages.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.commons.logging.LogdefaultLogDefault logger instanceprivate org.apache.commons.logging.Loglogprivate java.util.Set<java.lang.String>loggedMessagesprivate booleanskipFatal
-
Constructor Summary
Constructors Constructor Description LoggingEventListener()Creates an instance logging to the default log category of this class.LoggingEventListener(org.apache.commons.logging.Log log)Creates an instance logging to a given logger.LoggingEventListener(org.apache.commons.logging.Log log, boolean skipFatal)Creates an instance logging to a given logger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.logging.LoggetLog()Returns the target logger for this instance.voidprocessEvent(Event event)This method is called for each event that is generated.
-
-
-
Constructor Detail
-
LoggingEventListener
public LoggingEventListener()
Creates an instance logging to the default log category of this class.
-
LoggingEventListener
public LoggingEventListener(org.apache.commons.logging.Log log)
Creates an instance logging to a given logger. Events with fatal severity level will be skipped.- Parameters:
log- the target logger
-
LoggingEventListener
public LoggingEventListener(org.apache.commons.logging.Log log, boolean skipFatal)Creates an instance logging to a given logger.- Parameters:
log- the target loggerskipFatal- true if events with fatal severity level should be skipped (i.e. not logged)
-
-
Method Detail
-
getLog
public org.apache.commons.logging.Log getLog()
Returns the target logger for this instance.- Returns:
- the target logger
-
processEvent
public void processEvent(Event event)
This method is called for each event that is generated. With the event's ID it is possible to react to certain events. Events can also simply be recorded and presented to a user. It is possible to throw an (unchecked) exception if the processing needs to be aborted because some special event occurred. This way the client can configure the behaviour of the observed application.- Specified by:
processEventin interfaceEventListener- Parameters:
event- the event
-
-