fromJson static method

dynamic fromJson(
  1. String config
)

Implementation

static fromJson(String config) {
  try {
    Map<String, dynamic> json = jsonDecode(config);

    return Config(
        json[keyServiceId] ?? '',
        json[keyLoggingUrlHttp] ?? '',
        json[keyLoggingUrlHttps] ?? '',
        json[keyHost] ?? '',
        json[keyPcid] ?? '',
        json[keyUid] ?? '',
        json[keyCid] ?? '',
        json[keyAllowInquireAdid] ?? true,
        json[keyRequestMethod] ?? 'GET',
        json[keyRetryLogging] ?? false,
        json[keyRetryDelay] ?? 3000,
        json[keyQueueSize] ?? 100,
        json[keySessionTimeout] ?? 24 * 60 * 60 * 1000
    );
  }
  catch(exception) {
    Log.error('NLogger JSON parsing error - $exception');
    rethrow;
  }
}