DebuggerDisplayFormatting
using System;
using System.Runtime.CompilerServices;
namespace Microsoft.Extensions.Logging
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
internal static class DebuggerDisplayFormatting
{
internal static string DebuggerToString(string name, ILogger logger)
{
LogLevel? nullable = CalculateEnabledLogLevel(logger);
string str = "Name = \"" + name + "\"";
if (!nullable.HasValue)
return str + ", Enabled = false";
return str + $"""{nullable}";
}
internal static LogLevel? CalculateEnabledLogLevel(ILogger logger)
{
object obj = global::<PrivateImplementationDetails>.CAA894F8CBB8DC2FF3ED187413A26E53B37FCE43E7F0F09BAA4FE14884322DE8_A6;
if (obj == null) {
obj = new int[6] {
5,
4,
3,
2,
1,
0
};
global::<PrivateImplementationDetails>.CAA894F8CBB8DC2FF3ED187413A26E53B37FCE43E7F0F09BAA4FE14884322DE8_A6 = (int[])obj;
}
ReadOnlySpan<LogLevel> readOnlySpan = new ReadOnlySpan<LogLevel>((LogLevel[])obj);
LogLevel? result = null;
ReadOnlySpan<LogLevel> readOnlySpan2 = readOnlySpan;
foreach (LogLevel logLevel in readOnlySpan2) {
if (!logger.IsEnabled(logLevel))
break;
result = logLevel;
}
return result;
}
}
}