API
Java API

Store Exception

To record exceptions handled by a try-catch block, use RevDeBugAPI.Snapshot.RecordException and pass the exception object as a parameter. For example:
try{
var product = new Product();
product.convertData(dataFile);
}
catch (Exception e){
RevDeBug.Storage.getStorageApi().StoreException(error, CatchStateType.EXCEPTION);
}
The recorded snapshot of code execution that led to the exception will be stored on a Recording Server and visible on RevDeBug DevOps Monitoring dashboard in the same manner unhandled exceptions are.
To use a store exception, you must provide the exception object to be recorded by RevDeBug as arguments of the StoreException function and select one of the two exception types as the second argument:
  • CatchStateType.EXCEPTION - This is the normal type of exception
  • CatchStateType.LOG_ERROR - the exception will be marked in the exception table as log error
RevDeBug.Storage.getStorageApi().StoreException(exception_object, CatchStateType.LOG_ERROR);
RevDeBug.Storage.getStorageApi().StoreException(new Exception(), CatchStateType.EXCEPTION);

Store Snapshot

RevDeBug offers the possibility to create code recordings even when there is no exception. To use the function you should call the function anywhere in the program code. The place in the code where we used the snapshot function will be the end of the recording.
RevDeBug.Storage.getStorageApi().StoreSnapshot("Code segment execution");

Enable/Disable Recording From API

You can deactivate and activate the RevDeBug flight recorder at any time from the API.
To deactivate the flight recorder:
RevDeBug.Storage.getStorageApi().Deactivate();
To activate the flight recorder:
RevDeBug.Storage.getStorageApi().Activate();
To check if RevDeBug flight recorder is running or not:
RevDeBug.Storage.getStorageApi().IsActive()

Clear Thread Data

If you do not want to record a section of the code, all you have to do is use the ClearThreadData() function in the code, which will erase the current recording buffer. The code recording will start over from where ClearThreadData() is used.
RevDeBug.Storage.getStorageApi().ClearThreadData();

Set Maximum Recording Length

You can set the maximum length of the recording (the default is 1000). To do this via api use:
RevDeBug.Storage.getStorageApi().SetRecordingBacklog(1000);
The length of the recording is the number of application states that will be recorded, such as: variable values, values returned by methods, etc.