internal ConsoleLogger( string name, ConsoleLoggerProcessor loggerProcessor, ConsoleFormatter formatter, IExternalScopeProvider?scopeProvider, ConsoleLoggerOptions options) { ThrowHelper.ThrowIfNull(name); _name = name; _queueProcessor = loggerProcessor; Formatter = formatter; ScopeProvider = scopeProvider; Options = options; }
#pragma warning disable CS0618 private void UpdateFormatterOptions(ConsoleFormatter formatter, ConsoleLoggerOptions deprecatedFromOptions) { // kept for deprecated apis: if (formatter is SimpleConsoleFormatter defaultFormatter) { defaultFormatter.FormatterOptions = new SimpleConsoleFormatterOptions() { ColorBehavior = deprecatedFromOptions.DisableColors ? LoggerColorBehavior.Disabled : LoggerColorBehavior.Enabled, IncludeScopes = deprecatedFromOptions.IncludeScopes, TimestampFormat = deprecatedFromOptions.TimestampFormat, UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp, }; } else if (formatter is SystemdConsoleFormatter systemdFormatter) { systemdFormatter.FormatterOptions = new ConsoleFormatterOptions() { IncludeScopes = deprecatedFromOptions.IncludeScopes, TimestampFormat = deprecatedFromOptions.TimestampFormat, UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp, }; } }