private Configure ( LoggingSection section ) : void | ||
section | LoggingSection | |
Résultat | void |
internal void Configure(LoggingSection section)
{
if (section != null)
{
LogTo = section.LogTo;
LogResponses = section.LogResponses;
LogMetrics = section.LogMetrics.GetValueOrDefault(false);
LogMetricsFormat = section.LogMetricsFormat;
LogResponsesSizeLimit = section.LogResponsesSizeLimit.HasValue ? section.LogResponsesSizeLimit.Value : 1024;
if (section.LogMetricsCustomFormatter != null
&& typeof(IMetricsFormatter).IsAssignableFrom(section.LogMetricsCustomFormatter))
{
LogMetricsCustomFormatter = Activator.CreateInstance(section.LogMetricsCustomFormatter) as IMetricsFormatter;
}
}
}
}
internal RootConfig() { Logging = new LoggingConfig(); DynamoDB = new DynamoDBConfig(); S3 = new S3Config(); EC2 = new EC2Config(); Proxy = new ProxyConfig(); EndpointDefinition = AWSConfigs._endpointDefinition; Region = AWSConfigs._awsRegion; ProfileName = AWSConfigs._awsProfileName; ProfilesLocation = AWSConfigs._awsAccountsLocation; #if !WIN_RT && !WINDOWS_PHONE var root = AWSConfigs.GetSection<AWSSection>(_rootAwsSectionName); Logging.Configure(root.Logging); DynamoDB.Configure(root.DynamoDB); S3.Configure(root.S3); EC2.Configure(root.EC2); Proxy.Configure(root.Proxy); EndpointDefinition = Choose(EndpointDefinition, root.EndpointDefinition); Region = Choose(Region, root.Region); ProfileName = Choose(ProfileName, root.ProfileName); ProfilesLocation = Choose(ProfilesLocation, root.ProfilesLocation); #endif }