Skip to main content

Function Signature

Future<void> setLogLevel(PortalLogLevel level)

Description

Sets the log verbosity for the Portal SDK. The change takes effect immediately across all SDK components, including the native iOS and Android layers. Can be called before or after initialize(). When called before initialization, only the Dart-side logger is configured. When called after, the log level is also propagated to the native SDK.

Parameters

ParameterTypeRequiredDescription
levelPortalLogLevelYesThe desired log verbosity level

PortalLogLevel values

ValueDescription
PortalLogLevel.noneNo output. This is the default.
PortalLogLevel.errorFailures only — failed transactions, network errors, binary crashes.
PortalLogLevel.warnNon-fatal unexpected conditions — deprecated usage, retries, slow responses.
PortalLogLevel.infoOperational milestones — signing started, share generated, connection opened.
PortalLogLevel.debugFull internals — request/response payloads, timing, state transitions.
Each level includes all levels above it in severity.

Returns

void

Example

import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

await portal.initialize(apiKey: 'YOUR_CLIENT_API_KEY');

// Enable debug logging during development
await portal.setLogLevel(PortalLogLevel.debug);

// Create wallet — all SDK log output is now visible
final addresses = await portal.createWallet();
print('Ethereum address: ${addresses.ethereum}');

// Reduce to errors only
await portal.setLogLevel(PortalLogLevel.error);

Errors

CodeDescription
SET_LOG_LEVEL_ERRORFailed to set the native log level