Package org.jacoco.core.runtime
Class LoggerRuntime
java.lang.Object
org.jacoco.core.runtime.AbstractRuntime
org.jacoco.core.runtime.LoggerRuntime
- All Implemented Interfaces:
IExecutionDataAccessorGenerator
,IRuntime
This
IRuntime
implementation uses the Java logging API to report
coverage data.
The implementation uses a dedicated log channel. Instrumented classes call
Logger.log(Level, String, Object[])
with the class identifier in the
first slot of the parameter array. The runtime implements a Handler
for this channel that puts the probe data structure into the first slot of
the parameter array.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private final Handler
private final String
private final Logger
Fields inherited from class org.jacoco.core.runtime.AbstractRuntime
data
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Logger
int
generateDataAccessor
(long classid, String classname, int probecount, org.objectweb.asm.MethodVisitor mv) This method generates the byte code required to obtain the coverage data structure for the class with the given id.void
shutdown()
Allows the coverage runtime to cleanup internals.void
startup
(RuntimeData data) Subclasses must call this method when overwriting it.Methods inherited from class org.jacoco.core.runtime.AbstractRuntime
createRandomId
-
Field Details
-
CHANNEL
- See Also:
-
key
-
logger
-
handler
-
-
Constructor Details
-
LoggerRuntime
public LoggerRuntime()Creates a new runtime.
-
-
Method Details
-
configureLogger
-
generateDataAccessor
public int generateDataAccessor(long classid, String classname, int probecount, org.objectweb.asm.MethodVisitor mv) Description copied from interface:IExecutionDataAccessorGenerator
This method generates the byte code required to obtain the coverage data structure for the class with the given id. Typically the instrumentation process will embed this code into a method that is called on class initialization. This method can be called at any time even outside the target VM. The generated code must push aboolean[]
instance to the operand stack. Except this result object the generated code must not make any assumptions about the structure of the embedding method or class. The generated code must not use or allocate local variables.- Parameters:
classid
- identifier of the classclassname
- VM class nameprobecount
- probe count for this classmv
- code output- Returns:
- additional stack size required by the implementation, including the instance pushed to the stack
-
startup
Description copied from class:AbstractRuntime
Subclasses must call this method when overwriting it.- Specified by:
startup
in interfaceIRuntime
- Overrides:
startup
in classAbstractRuntime
- Parameters:
data
- the execution data for this runtime- Throws:
Exception
- any internal problem during startup
-
shutdown
public void shutdown()Description copied from interface:IRuntime
Allows the coverage runtime to cleanup internals. This class should be called when classes instrumented for this runtime are not used any more.
-