Skip to main content

Console logs (7.x Beta)

7.x Beta

This page documents the Android SDK 7.x beta. APIs may change before the stable release. For the current stable API, see the 6.x Logging page.

Automatic Logcat capture

Bugsee automatically captures android.util.Log.* calls made by your app and includes them in reports. Capture is enabled by default and is controlled by the CaptureLogs option (together with CaptureLogsLevel and CaptureLogsUseAllSources). See the Configuration page for the full option reference.

No special setup is required — as long as the Bugsee Gradle plugin's log instrumentation is enabled (it is by default), every android.util.Log.* call is rewritten to flow through the capture pipeline before delegating to the original method.

Pushing log entries manually

Bugsee.log(...) pushes a message into the capture buffer without printing it to Logcat. Useful when you want information to appear in the Bugsee report but not in your app's Logcat stream.

import com.bugsee.library.Bugsee;
import com.bugsee.library.data.LogLevel;

// Default level (Info)
Bugsee.log("User tapped Checkout");

// Explicit level
Bugsee.log("Payment succeeded", LogLevel.Info);
Bugsee.log("Retrying request", LogLevel.Warning);
Bugsee.log("Upload failed", LogLevel.Error);

Both overloads are no-ops if message is null or the SDK is not launched. If level is null, the SDK defaults to LogLevel.Info.

LogLevel values

Value
LogLevel.Error
LogLevel.Warning
LogLevel.Info
LogLevel.Debug
LogLevel.Verbose

Filtering log entries

7.x replaces the 6.x two-argument LogFilter with the single-method generic EventFilter<LogEvent> interface. Return the (possibly mutated) event to keep it, or return null to drop the entry entirely.

import com.bugsee.library.Bugsee;
import com.bugsee.library.contracts.exchange.LogEvent;

Bugsee.setLogEventFilter(log -> {
String message = log.getMessage();

// Drop noisy entries entirely
if (message != null && message.startsWith("[heartbeat]")) {
return null;
}

// Redact sensitive tokens
if (message != null && message.contains("token=")) {
log.setMessage(message.replaceAll("token=[^&\\s]+", "token=<redacted>"));
}

return log;
});

LogEvent exposes getMessage() / setMessage(String) and getLevel() / setLevel(LogLevel); mutate in place, then return the event.

setLogFilter(EventFilter<LogEvent>) is kept as an alias for setLogEventFilter(...) to ease call-site migration. See Migration guide, section 6 "Filtering: network and log events" for the full 6.x → 7.x diff.

Privacy

For redaction of sensitive information captured in logs, refer to the Privacy → Logs page.