/// <summary> /// cons /// </summary> /// <param name="loggerProvider">the underlying logger provider to use (Generally AWSLoggerProvider)</param> /// <param name="renderer">an augmenting renderer, such as StructuredRenderer</param> /// <param name="cfg">optional configuration; not used at the present</param> public AugmentingLoggerProvider(ILoggerProvider loggerProvider, IAugmentingRenderer renderer, IConfiguration cfg) { _loggerProvider = loggerProvider; _augrenderer = renderer; _cfg = cfg; }
/// <summary> /// if the augmenter is known to process LogScope using our own way, disable IncludeScopes for the underlying loggerprovider no matter what /// </summary> /// <param name="awsConfig"></param> /// <param name="augmenter"></param> /// <returns>the same awsConfig passed in; possibly mutated! also, original value of IncludeScopes</returns> internal static (AWSLoggerConfigSection, bool) ProcessIncludeScopes(this AWSLoggerConfigSection awsConfig, IAugmentingRenderer augmenter) { if (awsConfig != null) { var originalIncludeScopes = awsConfig.IncludeScopes; if (augmenter.RendersLogScope) { awsConfig.IncludeScopes = false; } return(awsConfig, originalIncludeScopes); } else { return(null, false); } }