net.sf.seam.perf4j
Class SeamLoggerStopWatch
java.lang.Object
org.perf4j.StopWatch
org.perf4j.LoggingStopWatch
net.sf.seam.perf4j.SeamLoggerStopWatch
- All Implemented Interfaces:
- Serializable, Cloneable
public class SeamLoggerStopWatch
- extends LoggingStopWatch
An implementation of Perf4j's LoggingStopWatch using Seam Logger to log messages.
- Author:
- Marcin ZajÄ…czkowski, 2010-01-30
- See Also:
- Serialized Form
| Methods inherited from class org.perf4j.LoggingStopWatch |
clone, getTimeThreshold, lap, lap, setMessage, setTag, setTimeThreshold, stop, stop, stop, stop |
| Methods inherited from class org.perf4j.StopWatch |
equals, getElapsedTime, getMessage, getStartTime, getTag, hashCode, lap, lap, start, start, start, stop, stop, toString |
DEFAULT_NORMAL_PRIORITY
public static final SeamLoggerStopWatch.LoggingLevel DEFAULT_NORMAL_PRIORITY
DEFAULT_EXCEPTION_PRIORITY
public static final SeamLoggerStopWatch.LoggingLevel DEFAULT_EXCEPTION_PRIORITY
SeamLoggerStopWatch
public SeamLoggerStopWatch()
- Default constructor.
SeamLoggerStopWatch
public SeamLoggerStopWatch(SeamLoggerStopWatch.LoggingLevel normalPriority)
SeamLoggerStopWatch
public SeamLoggerStopWatch(SeamLoggerStopWatch.LoggingLevel normalPriority,
SeamLoggerStopWatch.LoggingLevel exceptionPriority)
SeamLoggerStopWatch
public SeamLoggerStopWatch(String normalPriority)
SeamLoggerStopWatch
public SeamLoggerStopWatch(String normalPriority,
String exceptionPriority)
SeamLoggerStopWatch
public SeamLoggerStopWatch(org.jboss.seam.log.Log logger)
SeamLoggerStopWatch
public SeamLoggerStopWatch(org.jboss.seam.log.Log logger,
String normalPriority)
SeamLoggerStopWatch
public SeamLoggerStopWatch(org.jboss.seam.log.Log logger,
String normalPriority,
String exceptionPriority)
SeamLoggerStopWatch
public SeamLoggerStopWatch(org.jboss.seam.log.Log logger,
SeamLoggerStopWatch.LoggingLevel normalPriority)
SeamLoggerStopWatch
public SeamLoggerStopWatch(org.jboss.seam.log.Log logger,
SeamLoggerStopWatch.LoggingLevel normalPriority,
SeamLoggerStopWatch.LoggingLevel exceptionPriority)
- Constructs StopWatch with given logger and given logging levels (priorities).
- Parameters:
logger - logger to usenormalPriority - default logging level to useexceptionPriority - logging level to use when exception occurred
getLogger
public org.jboss.seam.log.Log getLogger()
getNormalPriority
public SeamLoggerStopWatch.LoggingLevel getNormalPriority()
getExceptionPriority
public SeamLoggerStopWatch.LoggingLevel getExceptionPriority()
isLogging
public boolean isLogging()
- Determines if logging is currently enabled for normal log messages printed by StopWatch.
In implementation isXXXEnabled() from org.jboss.seam.log.Log interface is used.
- Overrides:
isLogging in class LoggingStopWatch
- Returns:
- true if calls of stop() method that do not take an exception will be logged using logger
log
protected void log(String stopWatchAsString,
Throwable exception)
- Logs StopWatch message using Seam's logger.
- Overrides:
log in class LoggingStopWatch
- Parameters:
stopWatchAsString - serialized StopWatch stringexception - optional exception passed to be logged
Copyright © 2010. All Rights Reserved.