constructor |
public AuditTimer(): Default constructor. Default
logger gov.va.med.foundations.utilities.AuditTimer will be used.
public AuditTimer(org.apache.log4j.Logger logger): Constructor that accepts
logger to be used for output. Application can pass in their own loggers to
have granual control over logging.
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
logger |
Input |
(optional) org.apache.log4j.Logger: logger to use to
write AuditTimer output to.
|
|
start |
public void start(): Starts the timer.
|
|
stop |
public long stop(): Stops the timer. If start() was
not called at least once before stop() is called timeElapsedMillis is set to
-1. This method does not throw Exceptions, to keep client code simple.
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
return |
Output |
returns long: elapsed time since timer start in
milliseconds (or -1 if timer not started.)
|
|
getTimeElapsedMillis() |
public long getTimeElapsedMillis(): returns the
elapsed milliseconds between the last start()/stop() cycle.
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
return |
Output |
returns long: # of elapsed milliseconds between last
start()/stop() cycle.
|
|
log |
public void log(): Logs a message to the log4j logger
in a following format: elapsed_time_milliseconds
public void log(java.lang.String message): Logs a message to the log4j logger
in a following format: your_message elapsed_time_milliseconds
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
message |
Input |
(optional) java.lang.String message: message to
prepend to output.
|
|
isAuditTimerEnabled() |
public static boolean isAuditTimerEnabled(): returns
whether info-level is currently enabled on the default logger.
public static boolean isAuditTimerEnabled(org.apache.log4j.Logger logger):
returns whether info-level logging is currently enabled for the specified
logger (AuditTimer log writes use info-level loggers).
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
return |
Output |
returns boolean: true if info-level logging is on,
false if not.
|
logger |
Input |
(optional) org.apache.log4j.Logger: the logger to
check. If not passed, the default logger is checked.
|
|