diff --git a/scripts/build-preview.ps1 b/scripts/build-preview.ps1 index 3a0d57f5..1637e003 100644 --- a/scripts/build-preview.ps1 +++ b/scripts/build-preview.ps1 @@ -1 +1 @@ -dotnet build -c Release '-p:GeneratePackages=true;PackageVersion=3.0.1-preview.1' $PSScriptRoot/../src/log4net/log4net.csproj \ No newline at end of file +dotnet build -c Release '-p:GeneratePackages=true;PackageVersion=3.0.1-preview.2' $PSScriptRoot/../src/log4net/log4net.csproj \ No newline at end of file diff --git a/src/log4net.Tests/Appender/FileAppenderTest.cs b/src/log4net.Tests/Appender/FileAppenderTest.cs index 709aa5ee..58bcf5c4 100644 --- a/src/log4net.Tests/Appender/FileAppenderTest.cs +++ b/src/log4net.Tests/Appender/FileAppenderTest.cs @@ -92,8 +92,6 @@ public void FilenameWithPatternStringTest() """); ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString()); XmlConfigurator.Configure(rep, log4netConfig["log4net"]!); - ILog log = LogManager.GetLogger(rep.Name, "GeneralFileAppender"); - log.Info("Message"); } finally { diff --git a/src/log4net/Util/TypeConverters/ConverterRegistry.cs b/src/log4net/Util/TypeConverters/ConverterRegistry.cs index fb0b4cad..5837db82 100644 --- a/src/log4net/Util/TypeConverters/ConverterRegistry.cs +++ b/src/log4net/Util/TypeConverters/ConverterRegistry.cs @@ -27,8 +27,7 @@ namespace log4net.Util.TypeConverters /// /// /// - /// Maintains a registry of type converters used to convert between - /// types. + /// Maintains a registry of type converters used to convert between types. /// /// /// Use the and @@ -44,13 +43,8 @@ namespace log4net.Util.TypeConverters public static class ConverterRegistry { /// - /// Static constructor. + /// This class constructor adds the intrinsic type converters /// - /// - /// - /// This constructor defines the intrinsic type converters. - /// - /// static ConverterRegistry() { // Add predefined converters here @@ -67,23 +61,19 @@ static ConverterRegistry() /// /// The type being converted to. /// The type converter to use to convert to the destination type. - /// - /// - /// Adds a converter instance for a specific type. - /// - /// public static void AddConverter(Type? destinationType, object? converter) { - if (destinationType is not null && converter is not null) + if (destinationType is null || converter is null) { - if (converter is IConvertTo convertTo) - { - s_type2ConvertTo[destinationType] = convertTo; - } - else if (converter is IConvertFrom convertFrom) - { - s_type2ConvertFrom[destinationType] = convertFrom; - } + return; + } + if (converter is IConvertTo convertTo) + { + s_type2ConvertTo[destinationType] = convertTo; + } + if (converter is IConvertFrom convertFrom) + { + s_type2ConvertFrom[destinationType] = convertFrom; } } @@ -92,15 +82,8 @@ public static void AddConverter(Type? destinationType, object? converter) /// /// The type being converted to. /// The type of the type converter to use to convert to the destination type. - /// - /// - /// Adds a converter for a specific type. - /// - /// public static void AddConverter(Type destinationType, Type converterType) - { - AddConverter(destinationType, CreateConverterInstance(converterType)); - } + => AddConverter(destinationType, CreateConverterInstance(converterType)); /// /// Gets the type converter to use to convert values to the destination type. @@ -111,11 +94,6 @@ public static void AddConverter(Type destinationType, Type converterType) /// The type converter instance to use for type conversions or null /// if no type converter is found. /// - /// - /// - /// Gets the type converter to use to convert values to the destination type. - /// - /// public static IConvertTo? GetConvertTo(Type sourceType, Type destinationType) { // TODO: Support inheriting type converters. @@ -146,11 +124,6 @@ public static void AddConverter(Type destinationType, Type converterType) /// The type converter instance to use for type conversions or null /// if no type converter is found. /// - /// - /// - /// Gets the type converter to use to convert values to the destination type. - /// - /// public static IConvertFrom? GetConvertFrom(Type destinationType) { // TODO: Support inheriting type converters. @@ -248,4 +221,4 @@ public static void AddConverter(Type destinationType, Type converterType) private static readonly ConcurrentDictionary s_type2ConvertTo = new(); private static readonly ConcurrentDictionary s_type2ConvertFrom = new(); } -} +} \ No newline at end of file diff --git a/src/site/xdoc/release/release-notes.xml b/src/site/xdoc/release/release-notes.xml index 180affb4..45237a8b 100644 --- a/src/site/xdoc/release/release-notes.xml +++ b/src/site/xdoc/release/release-notes.xml @@ -28,7 +28,8 @@ limitations under the License.