File: ConsoleLoggerSettings.cs
Web Access
Project: src\src\libraries\Microsoft.Extensions.Logging.Console\src\Microsoft.Extensions.Logging.Console.csproj (Microsoft.Extensions.Logging.Console)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Extensions.Primitives;
 
namespace Microsoft.Extensions.Logging.Console
{
    /// <summary>
    /// This type is retained only for compatibility. The recommended alternative is ConsoleLoggerOptions.
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("This type is retained only for compatibility. The recommended alternative is ConsoleLoggerOptions.", error: true)]
    public class ConsoleLoggerSettings : IConsoleLoggerSettings
    {
        /// <inheritdoc/>
        public IChangeToken? ChangeToken { get; set; }
 
        /// <inheritdoc/>
        public bool IncludeScopes { get; set; }
 
        /// <summary>
        /// This property is retained only for compatibility.
        /// </summary>
        public bool DisableColors { get; set; }
 
        /// <summary>
        /// This property is retained only for compatibility.
        /// </summary>
        public IDictionary<string, LogLevel> Switches { get; set; } = new Dictionary<string, LogLevel>();
 
        /// <inheritdoc/>
        public IConsoleLoggerSettings Reload()
        {
            return this;
        }
 
        /// <inheritdoc/>
        public bool TryGetSwitch(string name, out LogLevel level)
        {
            return Switches.TryGetValue(name, out level);
        }
    }
}