Skip to main content
By default, the Portal SDK emits no logs. You can enable logging at any verbosity level to help debug integration issues or monitor SDK behavior in development.

Log levels

The PortalLogLevel enum defines five levels. Each level includes all levels above it in severity.
LevelWhat is logged
PortalLogLevel.noneNothing. This is the default.
PortalLogLevel.errorFailures only — failed transactions, network errors, binary crashes.
PortalLogLevel.warnUnexpected but non-fatal conditions — deprecated usage, retries, slow responses.
PortalLogLevel.infoNormal operational milestones — signing started, share generated, connection opened.
PortalLogLevel.debugEverything, including internals — request/response payloads, timing, state transitions.

Set the log level

At initialization

Pass logLevel when initializing your Portal instance.
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

await portal.initialize(
  apiKey: 'YOUR_CLIENT_API_KEY',
  logLevel: PortalLogLevel.debug,
);

At runtime

Call portal.setLogLevel() at any time. The change takes effect immediately across all SDK components — no reinitialization needed.
// Enable debug logging during development
await portal.setLogLevel(PortalLogLevel.debug);

// Later, reduce to errors only
await portal.setLogLevel(PortalLogLevel.error);
Set the log level before calling any other SDK methods to capture all output from the start.
  • Development: PortalLogLevel.debug — see all SDK activity while building your integration.
  • QA / staging: PortalLogLevel.info or PortalLogLevel.warn — surface operational milestones and anomalies without noise.
  • Production: PortalLogLevel.none (default) — no logs emitted. Use PortalLogLevel.error if you want to forward failures to a crash reporter.
Do not use PortalLogLevel.debug in production. Debug output includes request payloads and internal state that may contain sensitive data.
Related Documentation