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.
LevelValueWhat is logged
.none0Nothing. This is the default.
.error1Failures only — failed transactions, network errors, binary crashes.
.warn2Unexpected but non-fatal conditions — deprecated usage, retries, slow responses.
.info3Normal operational milestones — signing started, share generated, connection opened.
.debug4Everything, including internals — request/response payloads, timing, state transitions.

Set the log level

Call portal.setLogLevel(_:) after initializing your Portal instance. The change takes effect immediately across all SDK components.
import PortalSwift

let portal = try Portal(
  "YOUR_CLIENT_API_KEY",
  withRpcConfig: ["eip155:1": "https://mainnet.infura.io/v3/YOUR_INFURA_KEY"]
)

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

Log output

Logs are written using os_log to the io.portalhq.ios subsystem under the General category. You can filter them in the Console app or Xcode’s debug console using:
subsystem:io.portalhq.ios
Related Documentation