Logging

This section covers how Instabug automatically attaches the console logs, the verbose logs, all the steps done by the user until a bug report is sent.

You can send a variety of logs types with each crash or bug report. They will appear withing each report on your Instabug dashboard as shown below. The cut-off point of the log collection is when Instabug is invoked.

Instabug Logs

You can log messages throughout your application's life-cycle. Those logs are going to be sent with each report.

Instabug.logVerbose("Message to log")
Instabug.logInfo("Message to log")
Instabug.logDebug("Message to log")
Instabug.logError("Message to log")
Instabug.logWarn("Message to log")

User Steps

Instabug can detect user steps that can help you regenerate a bug in your app. To Allow or disallow Instabug to record user steps, you need to call the following method.

//Availble on iOS only
Instabug.setUserStepsEnabled(true);

User steps will be formatted as follows:
Event in label of type class in controller.

The type of events captured are tap, long press, force touch, swipe, scroll and pinch.
The label would be the label of the object that contains the event.
Class would be the class of the object that contains the event.
Controller would be the view that contained the event.

Visual Repro Steps

The set of steps that the user commits while they are in a specific view are grouped together. When the user navigates to a new view, this action is reflected in the repro steps and all the interactions happening within the new view are grouped together until the user navigates away from this view.

This feature is enabled by default starting from the Silver Plan. You can control it through the following API.

Instabug.setReproStepsMode(Instabug.reproStepsMode.enabled);

Here are the possible arguments.

Instabug.reproStepsMode.enabled
Instabug.reproStepsMode.disabled
Instabug.reproStepsMode.enabledWithNoScreenshots

To Allow Instabug to record user steps on Android, you need to call the following method from your Activity. Please note that this step is not required for iOS.

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
	InstabugTrackingDelegate.notifyActivityGotTouchEvent(ev, this);
	return super.dispatchTouchEvent(ev);
}

User Events

You can log custom user events throughout your application. Events are automatically going to be included with each report.

Instabug.logUserEventWithName("OnFeedbackButtonClicked");