|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.tracing.JulTimingTracer
public class JulTimingTracer
A Tracer implementation that used java.util.logging entering
exiting logger as tracing sink and adds timing information.
The format of the added timing information is '(after {0}ms)', the
precision relies on System.currentTimeMillis().
See Logger.entering(String, String) for an example.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jcoderz.commons.tracing.Tracer |
|---|
Tracer.TracingToken |
| Method Summary | |
|---|---|
Tracer.TracingToken |
entering(String className,
String methodName)
Delegates to Logger.entering(String, String). |
Tracer.TracingToken |
entering(String className,
String methodName,
Object argument)
Delegates to Logger.entering(String, String, Object). |
Tracer.TracingToken |
entering(String className,
String methodName,
Object[] arguments)
Delegates to Logger.entering(String, String, Object). |
void |
exiting(Tracer.TracingToken token)
Logs the method exit like Logger.exiting(String, String) with additional
execution time information. |
void |
exiting(Tracer.TracingToken token,
Object result)
Logs the returned result like Logger.exiting(String, String, Object) with additional
execution time information. |
String |
getClassName()
Returns the Name of the class where this tracer belongs to. |
static JulTimingTracer |
getTracer(String className)
Factory for a tracer for classes with the given name. |
boolean |
isTracing()
Returns true, if the level of the underlying java logger is Level.FINER or below. |
boolean |
isTracingArguments()
Returns always true. |
void |
throwing(Tracer.TracingToken token,
Throwable thrown)
Logs the thrown exception like Logger.throwing(String, String, Throwable) with additional
execution time information. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static JulTimingTracer getTracer(String className)
className - the name of the class that uses this tracer.
public boolean isTracing()
Level.FINER or below.
isTracing in interface TracerTracer.isTracing()public boolean isTracingArguments()
isTracingArguments in interface TracerTracer.isTracingArguments()public String getClassName()
public Tracer.TracingToken entering(String className,
String methodName)
Logger.entering(String, String).
The className is expected to be the same as the tracer name and
is silently ignored.
entering in interface TracerclassName - name of the classmethodName - name of the method entered.
Tracer.entering(java.lang.String, java.lang.String)
public Tracer.TracingToken entering(String className,
String methodName,
Object argument)
Logger.entering(String, String, Object).
The className is expected to be the same as the tracer name and
is silently ignored.
entering in interface TracerTracer.entering(String, String, Object)
public Tracer.TracingToken entering(String className,
String methodName,
Object[] arguments)
Logger.entering(String, String, Object).
The className is expected to be the same as the tracer name and
is silently ignored.
entering in interface TracerTracer.entering(String, String, Object[])public void exiting(Tracer.TracingToken token)
Logger.exiting(String, String) with additional
execution time information.
If the token is not a JulTimingTracingToken the call is
silently ignored.
exiting in interface TracerTracer.exiting(TracingToken)
public void exiting(Tracer.TracingToken token,
Object result)
Logger.exiting(String, String, Object) with additional
execution time information.
If the token is not a JulTimingTracingToken the call is
silently ignored.
exiting in interface TracerTracer.exiting(TracingToken, java.lang.Object)
public void throwing(Tracer.TracingToken token,
Throwable thrown)
Logger.throwing(String, String, Throwable) with additional
execution time information.
If the token is not a JulTimingTracingToken the call is
silently ignored.
throwing in interface TracerTracer.throwing(TracingToken, java.lang.Throwable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||