setLoggingEnabled method Null safety

void setLoggingEnabled(
  1. bool loggingEnabled
)

This allows enabling or disabling of all Mixpanel logs at run time. All logging is disabled by default. Usually, this is only required if you are running into issues with the SDK that you want to debug

  • loggingEnabled whether to enable logging

Implementation

void setLoggingEnabled(bool loggingEnabled) {
  if (loggingEnabled != null) { // ignore: unnecessary_null_comparison
    _channel.invokeMethod<void>('setLoggingEnabled',
        <String, dynamic>{'loggingEnabled': loggingEnabled});
  } else {
    developer.log(
        '`setLoggingEnabled` failed: loggingEnabled cannot be blank',
        name: 'Mixpanel');
  }
}