setLogLevel method

Future<void> setLogLevel(
  1. TrustPinLogLevel level
)

Sets the current log level for this TrustPin instance's logging system.

Logging helps with debugging certificate pinning issues and monitoring security events. Different log levels provide varying amounts of detail.

Log Levels

Example Usage

// Enable debug logging for development
await TrustPin.shared.setLogLevel(TrustPinLogLevel.debug);

// Minimal logging for production
await TrustPin.shared.setLogLevel(TrustPinLogLevel.error);

// Disable all logging
await TrustPin.shared.setLogLevel(TrustPinLogLevel.none);

Performance Considerations

Implementation

Future<void> setLogLevel(TrustPinLogLevel level) async {
  try {
    await TrustPinSDKPlatform.instance
        .setLogLevel(level.value, instanceId: _instanceId);
  } catch (e) {
    throw TrustPinException.fromPlatformException(e);
  }
}