This tutorial version is obsolete - jump to the newest one

Selective recording

Create your custom monitoring system thanks to RevDeBug Selective Recording.

Estimated reading time: 3 mins

Last edited: 28 Nov 2019

Whitelist mode

By default, RevDeBug parses and processes all of the available code within a project. Whitelisting allows you to choose particular parts of your code. This means - if you enable whitelisting, only whitelisted elements will be recorded.

To enable RevDeBug Whitelist, you must add a annotation processor argument:

pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
	<compilerArgs>
	...
	<arg>-AREVDEBUG_ANNOTATED_ONLY=true<arg>
	<!---Default value = false-->
	...
	</compilerArgs>
    </configuration>
</plugin>
		
build.gradle

...
    compileJava {
        options.compilerArgs = [
		...
                "-AREVDEBUG_ANNOTATED_ONLY=true",
		//Default value = false
		...
    ]} 
...
		

Enable redording selected methods or classes (annotation):


@RevDeBug.Annotation.Include
public void main(String s) {}
 
Control recorded operations by compiler args
1. Disable recording value changes:
pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
	<compilerArgs>
	...
	<arg>-AREVDEBUG_TRACE_VALUE_CHANGE=false<arg>
	<!---Default value = true-->
	...
	</compilerArgs>
    </configuration>
</plugin>
			
2. Disable recording return statements:
pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
	<compilerArgs>
	...
	<arg>-AREVDEBUG_TRACE_RETURNING=false<arg>
	<!---Default value = true-->
	...
	</compilerArgs>
    </configuration>
</plugin>
			
3. Disable recording errors:
pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
	<compilerArgs>
	...
	<arg>-AREVDEBUG_TRACE_ON_ERROR=false<arg>
	<!---Default value = true-->
	...
	</compilerArgs>
    </configuration>
</plugin>
			
1. Disable recording value changes:
build.gradle

...
    compileJava {
        options.compilerArgs = [
		...
                "-AREVDEBUG_TRACE_VALUE_CHANGE=false",
		//Default value = true
		...
    ]} 
...
			
2. Disable recording return statements:
build.gradle

...
    compileJava {
        options.compilerArgs = [
		...
                "-AREVDEBUG_TRACE_RETURNING=false",
		//Default value = true
		...
    ]} 
...
			
3. Disable recording errors:
build.gradle

...
    compileJava {
        options.compilerArgs = [
		...
                "-AREVDEBUG_TRACE_ON_ERROR=false",
		//Default value = true
		...
    ]} 
...
			
Configure recorded code by compiler args
1. Disable recording methods by name:
pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
	<compilerArgs>
	...
	<arg>-AREVDEBUG_EXCLUDE_METHODS=[method1, m2, ...]<arg>
	<!---Default value = toString, equals, hashCode, compareTo-->
	...
	</compilerArgs>
    </configuration>
</plugin>
			
2. Disable recording classes or packages:
pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
	<compilerArgs>
	...
	<arg>-AREVDEBUG_EXCLUDE=[package.classname, package]<arg>
	<!---Default value = none-->
	...
	</compilerArgs>
    </configuration>
</plugin>
			
3. Disable recording methods with operations count less than entered value:
pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
	<compilerArgs>
	...
	<arg>-AREVDEBUG_SHORT_METHOD_LIMIT=[Integer]<arg>
	<!---Default value = none-->
	...
	</compilerArgs>
    </configuration>
</plugin>
			
1. Disable recording methods by name:
build.gradle

...
    compileJava {
        options.compilerArgs = [
		...
                "-AREVDEBUG_EXCLUDE_METHODS=[method1, m2, ...]",
		//Default value = toString, equals, hashCode, compareTo
		...
    ]} 
...
			
2. Disable recording classes or packages:
build.gradle

...
    compileJava {
        options.compilerArgs = [
		...
                "-AREVDEBUG_EXCLUDE=[package.classname, package]",
		//Default value = none
		...
    ]} 
...
			
3. Disable recording methods with operations count less than entered value:
build.gradle

...
    compileJava {
        options.compilerArgs = [
		...
                "-AREVDEBUG_SHORT_METHOD_LIMIT=[Integer]",
		//Default value = none
		...
    ]} 
...
			
Configure recorded code by code annotations

Exclude class or method:


@RevDeBug.Annotation.Exclude
public void main(String s) {}