setLogLevel static method

Future<void> setLogLevel(
  1. TrustPinLogLevel level
)

Sets the current log level for TrustPin's internal 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.setLogLevel(TrustPinLogLevel.debug);

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

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

Performance Considerations

Implementation

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