diff --git a/src/Logging/Logging.Abstractions/src/Internal/FormattedLogValues.cs b/src/Logging/Logging.Abstractions/src/FormattedLogValues.cs similarity index 95% rename from src/Logging/Logging.Abstractions/src/Internal/FormattedLogValues.cs rename to src/Logging/Logging.Abstractions/src/FormattedLogValues.cs index a639bdea1c5..05892d6a8a5 100644 --- a/src/Logging/Logging.Abstractions/src/Internal/FormattedLogValues.cs +++ b/src/Logging/Logging.Abstractions/src/FormattedLogValues.cs @@ -7,13 +7,13 @@ using System.Collections.Generic; using System.Threading; -namespace Microsoft.Extensions.Logging.Internal +namespace Microsoft.Extensions.Logging { /// /// LogValues to enable formatting options supported by . /// This also enables using {NamedformatItem} in the format string. /// - public readonly struct FormattedLogValues : IReadOnlyList> + internal readonly struct FormattedLogValues : IReadOnlyList> { internal const int MaxCachedFormatters = 1024; private const string NullFormat = "[null]"; diff --git a/src/Logging/Logging.Abstractions/src/ILoggerOfT.cs b/src/Logging/Logging.Abstractions/src/ILoggerT.cs similarity index 97% rename from src/Logging/Logging.Abstractions/src/ILoggerOfT.cs rename to src/Logging/Logging.Abstractions/src/ILoggerT.cs index db6535ceea7..4304337ced1 100644 --- a/src/Logging/Logging.Abstractions/src/ILoggerOfT.cs +++ b/src/Logging/Logging.Abstractions/src/ILoggerT.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; - namespace Microsoft.Extensions.Logging { /// diff --git a/src/Logging/Logging.Abstractions/src/Internal/LogValuesFormatter.cs b/src/Logging/Logging.Abstractions/src/LogValuesFormatter.cs similarity index 95% rename from src/Logging/Logging.Abstractions/src/Internal/LogValuesFormatter.cs rename to src/Logging/Logging.Abstractions/src/LogValuesFormatter.cs index b96f282ac39..33551387869 100644 --- a/src/Logging/Logging.Abstractions/src/Internal/LogValuesFormatter.cs +++ b/src/Logging/Logging.Abstractions/src/LogValuesFormatter.cs @@ -8,12 +8,12 @@ using System.Globalization; using System.Text; -namespace Microsoft.Extensions.Logging.Internal +namespace Microsoft.Extensions.Logging { /// /// Formatter to convert the named format items like {NamedformatItem} to format. /// - public class LogValuesFormatter + internal class LogValuesFormatter { private const string NullValue = "(null)"; private static readonly object[] EmptyArray = new object[0]; @@ -34,9 +34,6 @@ public LogValuesFormatter(string format) var openBraceIndex = FindBraceIndex(format, '{', scanIndex, endIndex); var closeBraceIndex = FindBraceIndex(format, '}', openBraceIndex, endIndex); - // Format item syntax : { index[,alignment][ :formatString] }. - var formatDelimiterIndex = FindIndexOfAny(format, FormatDelimiters, openBraceIndex, closeBraceIndex); - if (closeBraceIndex == endIndex) { sb.Append(format, scanIndex, endIndex - scanIndex); @@ -44,6 +41,9 @@ public LogValuesFormatter(string format) } else { + // Format item syntax : { index[,alignment][ :formatString] }. + var formatDelimiterIndex = FindIndexOfAny(format, FormatDelimiters, openBraceIndex, closeBraceIndex); + sb.Append(format, scanIndex, openBraceIndex - scanIndex + 1); sb.Append(_valueNames.Count.ToString(CultureInfo.InvariantCulture)); _valueNames.Add(format.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1)); diff --git a/src/Logging/Logging.Abstractions/src/LoggerExtensions.cs b/src/Logging/Logging.Abstractions/src/LoggerExtensions.cs index 49176eb7538..755317a95b3 100644 --- a/src/Logging/Logging.Abstractions/src/LoggerExtensions.cs +++ b/src/Logging/Logging.Abstractions/src/LoggerExtensions.cs @@ -2,9 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Globalization; -using Microsoft.Extensions.Logging.Internal; namespace Microsoft.Extensions.Logging { diff --git a/src/Logging/Logging.Abstractions/src/LoggerExternalScopeProvider.cs b/src/Logging/Logging.Abstractions/src/LoggerExternalScopeProvider.cs index f21a907b14a..17448e8bc3b 100644 --- a/src/Logging/Logging.Abstractions/src/LoggerExternalScopeProvider.cs +++ b/src/Logging/Logging.Abstractions/src/LoggerExternalScopeProvider.cs @@ -2,11 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; using System.Threading; -using Microsoft.Extensions.Logging; namespace Microsoft.Extensions.Logging { @@ -73,4 +69,4 @@ public void Dispose() } } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.Abstractions/src/LoggerFactoryExtensions.cs b/src/Logging/Logging.Abstractions/src/LoggerFactoryExtensions.cs index 7335dec0948..6e83c7fa99d 100644 --- a/src/Logging/Logging.Abstractions/src/LoggerFactoryExtensions.cs +++ b/src/Logging/Logging.Abstractions/src/LoggerFactoryExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.Extensions.Logging.Abstractions.Internal; namespace Microsoft.Extensions.Logging { @@ -44,4 +43,4 @@ public static ILogger CreateLogger(this ILoggerFactory factory, Type type) return factory.CreateLogger(TypeNameHelper.GetTypeDisplayName(type)); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.Abstractions/src/LoggerMessage.cs b/src/Logging/Logging.Abstractions/src/LoggerMessage.cs index 3a120297053..ab4e68e1f7e 100644 --- a/src/Logging/Logging.Abstractions/src/LoggerMessage.cs +++ b/src/Logging/Logging.Abstractions/src/LoggerMessage.cs @@ -1,11 +1,10 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections; using System.Collections.Generic; using Microsoft.Extensions.Logging.Abstractions; -using Microsoft.Extensions.Logging.Internal; namespace Microsoft.Extensions.Logging { diff --git a/src/Logging/Logging.Abstractions/src/LoggerOfT.cs b/src/Logging/Logging.Abstractions/src/LoggerT.cs similarity index 96% rename from src/Logging/Logging.Abstractions/src/LoggerOfT.cs rename to src/Logging/Logging.Abstractions/src/LoggerT.cs index b2ba187c521..d76b0533a68 100644 --- a/src/Logging/Logging.Abstractions/src/LoggerOfT.cs +++ b/src/Logging/Logging.Abstractions/src/LoggerT.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.Extensions.Logging.Abstractions.Internal; namespace Microsoft.Extensions.Logging { @@ -44,4 +43,4 @@ void ILogger.Log(LogLevel logLevel, EventId eventId, TState state, Excep _logger.Log(logLevel, eventId, state, exception, formatter); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.Abstractions/src/NullLoggerOfT.cs b/src/Logging/Logging.Abstractions/src/NullLoggerT.cs similarity index 100% rename from src/Logging/Logging.Abstractions/src/NullLoggerOfT.cs rename to src/Logging/Logging.Abstractions/src/NullLoggerT.cs diff --git a/src/Logging/Logging.Abstractions/src/Internal/TypeNameHelper.cs b/src/Logging/Logging.Abstractions/src/TypeNameHelper.cs similarity index 96% rename from src/Logging/Logging.Abstractions/src/Internal/TypeNameHelper.cs rename to src/Logging/Logging.Abstractions/src/TypeNameHelper.cs index 4e998567213..e6b891f70fd 100644 --- a/src/Logging/Logging.Abstractions/src/Internal/TypeNameHelper.cs +++ b/src/Logging/Logging.Abstractions/src/TypeNameHelper.cs @@ -5,9 +5,9 @@ using System.Collections.Generic; using System.Reflection; -namespace Microsoft.Extensions.Logging.Abstractions.Internal +namespace Microsoft.Extensions.Logging { - public class TypeNameHelper + internal class TypeNameHelper { private static readonly Dictionary _builtInTypeNames = new Dictionary { @@ -78,4 +78,4 @@ public static string GetTypeDisplayName(Type type) } } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.Analyzers/src/LogFormatAnalyzer.cs b/src/Logging/Logging.Analyzers/src/LogFormatAnalyzer.cs index 99754762e4e..ee4bbaeedfc 100644 --- a/src/Logging/Logging.Analyzers/src/LogFormatAnalyzer.cs +++ b/src/Logging/Logging.Analyzers/src/LogFormatAnalyzer.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.Extensions.Logging.Internal; namespace Microsoft.Extensions.Logging.Analyzers { diff --git a/src/Logging/Logging.Analyzers/src/Microsoft.Extensions.Logging.Analyzers.csproj b/src/Logging/Logging.Analyzers/src/Microsoft.Extensions.Logging.Analyzers.csproj index 7b05f0cbe6e..1fbfe9050f7 100644 --- a/src/Logging/Logging.Analyzers/src/Microsoft.Extensions.Logging.Analyzers.csproj +++ b/src/Logging/Logging.Analyzers/src/Microsoft.Extensions.Logging.Analyzers.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Logging/Logging.Analyzers/test/LoggingDiagnosticRunner.cs b/src/Logging/Logging.Analyzers/test/LoggingDiagnosticRunner.cs index 8ffde0bdc85..3fd2815ef77 100644 --- a/src/Logging/Logging.Analyzers/test/LoggingDiagnosticRunner.cs +++ b/src/Logging/Logging.Analyzers/test/LoggingDiagnosticRunner.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Analyzer.Testing; using Microsoft.CodeAnalysis; diff --git a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs b/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs index cbf9ec7d35d..79b486b585d 100644 --- a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs +++ b/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Logging/Logging.Configuration/src/LoggerProviderConfigurationFactory.cs b/src/Logging/Logging.Configuration/src/LoggerProviderConfigurationFactory.cs index 6657f5bfcff..46fde02fb66 100644 --- a/src/Logging/Logging.Configuration/src/LoggerProviderConfigurationFactory.cs +++ b/src/Logging/Logging.Configuration/src/LoggerProviderConfigurationFactory.cs @@ -1,9 +1,8 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; -using System.Reflection; using Microsoft.Extensions.Configuration; namespace Microsoft.Extensions.Logging.Configuration @@ -41,4 +40,4 @@ public IConfiguration GetConfiguration(Type providerType) return configurationBuilder.Build(); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.Console/src/ConsoleLogger.cs b/src/Logging/Logging.Console/src/ConsoleLogger.cs index 1711880a929..6643d56737f 100644 --- a/src/Logging/Logging.Console/src/ConsoleLogger.cs +++ b/src/Logging/Logging.Console/src/ConsoleLogger.cs @@ -3,7 +3,6 @@ using System; using System.Text; -using Microsoft.Extensions.Logging.Abstractions.Internal; namespace Microsoft.Extensions.Logging.Console { diff --git a/src/Logging/Logging.Console/src/ConsoleLoggerProvider.cs b/src/Logging/Logging.Console/src/ConsoleLoggerProvider.cs index 8e3bf1675d3..0d7d341e385 100644 --- a/src/Logging/Logging.Console/src/ConsoleLoggerProvider.cs +++ b/src/Logging/Logging.Console/src/ConsoleLoggerProvider.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Concurrent; using System.Runtime.InteropServices; -using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; namespace Microsoft.Extensions.Logging.Console diff --git a/src/Logging/Logging.Debug/src/DebugLoggerFactoryExtensions.cs b/src/Logging/Logging.Debug/src/DebugLoggerFactoryExtensions.cs index 26adf510299..9c8739af875 100644 --- a/src/Logging/Logging.Debug/src/DebugLoggerFactoryExtensions.cs +++ b/src/Logging/Logging.Debug/src/DebugLoggerFactoryExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging.Debug; diff --git a/src/Logging/Logging.Testing/src/RetryContext.cs b/src/Logging/Logging.Testing/src/RetryContext.cs index 2a774cfd3e8..529de656b5c 100644 --- a/src/Logging/Logging.Testing/src/RetryContext.cs +++ b/src/Logging/Logging.Testing/src/RetryContext.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; - namespace Microsoft.Extensions.Logging.Testing { public class RetryContext @@ -15,4 +13,4 @@ public class RetryContext internal int CurrentIteration { get; set; } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.Testing/src/TestLoggerFactory.cs b/src/Logging/Logging.Testing/src/TestLoggerFactory.cs index b0513fed664..7200e254b8c 100644 --- a/src/Logging/Logging.Testing/src/TestLoggerFactory.cs +++ b/src/Logging/Logging.Testing/src/TestLoggerFactory.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; - namespace Microsoft.Extensions.Logging.Testing { public class TestLoggerFactory : ILoggerFactory @@ -29,4 +27,4 @@ public void Dispose() { } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.Testing/src/TestLoggerOfT.cs b/src/Logging/Logging.Testing/src/TestLoggerT.cs similarity index 100% rename from src/Logging/Logging.Testing/src/TestLoggerOfT.cs rename to src/Logging/Logging.Testing/src/TestLoggerT.cs diff --git a/src/Logging/Logging.Testing/src/Xunit/LoggedTestRunner.cs b/src/Logging/Logging.Testing/src/Xunit/LoggedTestRunner.cs index 909ea10a6b9..7dc847a113d 100644 --- a/src/Logging/Logging.Testing/src/Xunit/LoggedTestRunner.cs +++ b/src/Logging/Logging.Testing/src/Xunit/LoggedTestRunner.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -9,7 +9,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; using Xunit.Abstractions; using Xunit.Sdk; diff --git a/src/Logging/Logging.Testing/test/XunitLoggerProviderTest.cs b/src/Logging/Logging.Testing/test/XunitLoggerProviderTest.cs index 9720e15a09a..c991073b4a8 100644 --- a/src/Logging/Logging.Testing/test/XunitLoggerProviderTest.cs +++ b/src/Logging/Logging.Testing/test/XunitLoggerProviderTest.cs @@ -3,7 +3,6 @@ using System; using System.Text.RegularExpressions; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Test; using Xunit; diff --git a/src/Logging/Logging/src/Logger.cs b/src/Logging/Logging/src/Logger.cs index 5ad42532c36..5ff08796d5c 100644 --- a/src/Logging/Logging/src/Logger.cs +++ b/src/Logging/Logging/src/Logger.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using Microsoft.Extensions.Logging.Abstractions.Internal; namespace Microsoft.Extensions.Logging { @@ -195,4 +194,4 @@ public void Dispose() } } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging/src/LoggerFactory.cs b/src/Logging/Logging/src/LoggerFactory.cs index aa136403fd8..76d87538f53 100644 --- a/src/Logging/Logging/src/LoggerFactory.cs +++ b/src/Logging/Logging/src/LoggerFactory.cs @@ -1,10 +1,9 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; using Microsoft.Extensions.Options; namespace Microsoft.Extensions.Logging diff --git a/src/Logging/test/Console/ConsoleSink.cs b/src/Logging/test/Console/ConsoleSink.cs index 0eefeb08ce6..d596134d92d 100644 --- a/src/Logging/test/Console/ConsoleSink.cs +++ b/src/Logging/test/Console/ConsoleSink.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; namespace Microsoft.Extensions.Logging.Test.Console @@ -15,4 +14,4 @@ public void Write(ConsoleContext context) Writes.Add(context); } } -} \ No newline at end of file +} diff --git a/src/Logging/test/DebugLoggerTest.cs b/src/Logging/test/DebugLoggerTest.cs index 41f0860d039..9449c91f818 100644 --- a/src/Logging/test/DebugLoggerTest.cs +++ b/src/Logging/test/DebugLoggerTest.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.Extensions.Logging.Debug; using Microsoft.Extensions.Logging.Test; using Xunit; diff --git a/src/Logging/test/FormattedLogValuesTest.cs b/src/Logging/test/FormattedLogValuesTest.cs index cedb2998233..ab60a85c7ae 100644 --- a/src/Logging/test/FormattedLogValuesTest.cs +++ b/src/Logging/test/FormattedLogValuesTest.cs @@ -3,7 +3,6 @@ using System; using System.Linq; -using Microsoft.Extensions.Logging.Internal; using Xunit; namespace Microsoft.Extensions.Logging.Test diff --git a/src/Logging/test/LoggerExtensionsTest.cs b/src/Logging/test/LoggerExtensionsTest.cs index 05211134980..722813245e1 100644 --- a/src/Logging/test/LoggerExtensionsTest.cs +++ b/src/Logging/test/LoggerExtensionsTest.cs @@ -5,7 +5,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using Microsoft.Extensions.Logging.Internal; using Microsoft.Extensions.Logging.Testing; using Xunit; diff --git a/src/Logging/test/LoggerFactoryTest.cs b/src/Logging/test/LoggerFactoryTest.cs index e6a64f664a2..e51ce70066d 100644 --- a/src/Logging/test/LoggerFactoryTest.cs +++ b/src/Logging/test/LoggerFactoryTest.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Text; using Moq; using Xunit; diff --git a/src/Logging/test/TraceSourceLoggerTest.cs b/src/Logging/test/TraceSourceLoggerTest.cs index 1b10ea9c61e..8ca1221aad6 100644 --- a/src/Logging/test/TraceSourceLoggerTest.cs +++ b/src/Logging/test/TraceSourceLoggerTest.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; -using Microsoft.Extensions.DependencyInjection; using Xunit; namespace Microsoft.Extensions.Logging.Test diff --git a/src/Logging/test/TraceSourceScopeTest.cs b/src/Logging/test/TraceSourceScopeTest.cs index 69713d7ee99..8a53598d0cf 100644 --- a/src/Logging/test/TraceSourceScopeTest.cs +++ b/src/Logging/test/TraceSourceScopeTest.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; -using Microsoft.Extensions.DependencyInjection; using Xunit; namespace Microsoft.Extensions.Logging.Test diff --git a/src/Shared/src/BenchmarkRunner/DefaultCoreValidationConfig.cs b/src/Shared/src/BenchmarkRunner/DefaultCoreValidationConfig.cs index 95fc725564d..5a90929cff8 100644 --- a/src/Shared/src/BenchmarkRunner/DefaultCoreValidationConfig.cs +++ b/src/Shared/src/BenchmarkRunner/DefaultCoreValidationConfig.cs @@ -1,11 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.Linq; -using System.Reflection; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Running; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Loggers;