getDefaultLogLevel method

int getDefaultLogLevel(
  1. SDKEnvironment environment
)

Get default log level for environment

Implementation

int getDefaultLogLevel(SDKEnvironment environment) {
  try {
    final lib = PlatformLoader.loadCommons();
    final getLogLevelFn = lib
        .lookupFunction<Int32 Function(Int32), int Function(int)>(
          'rac_env_default_log_level',
        );

    return getLogLevelFn(_environmentToInt(environment));
  } catch (e) {
    // Fallback defaults
    switch (environment) {
      case SDKEnvironment.SDK_ENVIRONMENT_DEVELOPMENT:
        return RacLogLevel.debug;
      case SDKEnvironment.SDK_ENVIRONMENT_STAGING:
        return RacLogLevel.info;
      case SDKEnvironment.SDK_ENVIRONMENT_PRODUCTION:
        return RacLogLevel.warning;
      default:
        return RacLogLevel.debug;
    }
  }
}