Skip to content

Commit 7e94dfb

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 5987449 + eb5b4d4 commit 7e94dfb

File tree

7 files changed

+43
-101
lines changed

7 files changed

+43
-101
lines changed

src/Simplify.DI/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [4.1.2] - 2021-10-25
4+
5+
### Dependencies
6+
7+
- Internal DryIoc bump to 4.8.3 (PR#314)
8+
39
## [4.1.1] - 2021-10-15
410

511
### Dependencies

src/Simplify.DI/Simplify.DI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1010
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1111

12-
<Version>4.1.1</Version>
12+
<Version>4.1.2</Version>
1313

1414
<Authors>Alexander Krylkov</Authors>
1515
<Product>Simplify</Product>
@@ -23,7 +23,7 @@
2323
<PackageReleaseNotes>See https://github.com/SimplifyNet/Simplify/tree/master/src/Simplify.DI/CHANGELOG.md for details</PackageReleaseNotes>
2424
</PropertyGroup>
2525
<ItemGroup>
26-
<PackageReference Include="DryIoc" Version="4.8.2" PrivateAssets="All" />
26+
<PackageReference Include="DryIoc" Version="4.8.3" PrivateAssets="All" />
2727
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
2828
</ItemGroup>
2929
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">

src/Simplify.Log/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Changelog
2+
3+
## [2.0.0] - 2021-10-26
4+
5+
### Removed
6+
7+
- `ConfigurationManagerBasedLoggerSettings`
8+
- `_currentLogFileName` calculation based on `HttpContext.Current.Request.PhysicalApplicationPath` and `System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath`
9+
- Default singleton
10+
11+
### Dependencies
12+
13+
- Microsoft.Extensions.Configuration switch to Microsoft.Extensions.Configuration.Abstactions 5.0.0
14+
- System.IO.Abstractions bump to 13.2.47
15+
- System.Web dependency dropped
16+
- System.ServiceModel dependency dropped
17+
- System.Configuration dependency dropped
18+
19+
### Added
20+
21+
- .NET Standard 2.0 support
22+
- .NET 5 explicit support

src/Simplify.Log/Logger.cs

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
using Microsoft.Extensions.Configuration;
2-
using Simplify.Log.Settings;
3-
using Simplify.Log.Settings.Impl;
4-
using System;
1+
using System;
52
using System.Diagnostics;
63
using System.Globalization;
74
using System.IO;
85
using System.IO.Abstractions;
96
using System.Reflection;
10-
using System.ServiceModel;
117
using System.Web;
8+
using Microsoft.Extensions.Configuration;
9+
using Simplify.Log.Settings;
10+
using Simplify.Log.Settings.Impl;
1211

1312
namespace Simplify.Log
1413
{
@@ -18,22 +17,10 @@ namespace Simplify.Log
1817
public class Logger : ILogger
1918
{
2019
private static Lazy<IFileSystem> _fileSystem = new Lazy<IFileSystem>(() => new FileSystem());
21-
private static Lazy<ILogger> _defaultLogger = new Lazy<ILogger>(() => new Logger(LoggerSettings.DefaultConfigSectionName));
2220

2321
private readonly object _locker = new object();
2422
private string _currentLogFileName;
2523

26-
/// <summary>
27-
/// Initializes a new instance of the <see cref="Logger"/> class.
28-
/// </summary>
29-
/// <param name="configSectionName">Name of the configuration section in the configuration file.</param>
30-
public Logger(string configSectionName = LoggerSettings.DefaultConfigSectionName)
31-
{
32-
Settings = new ConfigurationManagerBasedLoggerSettings(configSectionName);
33-
34-
Initialize();
35-
}
36-
3724
/// <summary>
3825
/// Initializes a new instance of the <see cref="Logger" /> class.
3926
/// </summary>
@@ -61,25 +48,6 @@ public Logger(int maxFileSize = LoggerSettings.DefaultMaxFileSize, string fileNa
6148
Initialize();
6249
}
6350

64-
/// <summary>
65-
/// Gets or sets the default logger instance.
66-
/// </summary>
67-
/// <value>
68-
/// The default logger instance.
69-
/// </value>
70-
/// <exception cref="ArgumentNullException">value</exception>
71-
public static ILogger Default
72-
{
73-
get => _defaultLogger.Value;
74-
set
75-
{
76-
if (value == null)
77-
throw new ArgumentNullException(nameof(value));
78-
79-
_defaultLogger = new Lazy<ILogger>(() => value);
80-
}
81-
}
82-
8351
/// <summary>
8452
/// Gets the logger settings.
8553
/// </summary>
@@ -231,10 +199,6 @@ private void Initialize()
231199
{
232200
if (Settings.PathType == LoggerPathType.FullPath)
233201
_currentLogFileName = Settings.FileName;
234-
else if (HttpContext.Current != null)
235-
_currentLogFileName = $"{HttpContext.Current.Request.PhysicalApplicationPath}{Settings.FileName}";
236-
else if (OperationContext.Current != null)
237-
_currentLogFileName = $"{System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath}{Settings.FileName}";
238202
else
239203
_currentLogFileName = $"{Path.GetDirectoryName(Assembly.GetCallingAssembly().Location)}/{Settings.FileName}";
240204
}

src/Simplify.Log/Settings/Impl/ConfigurationManagerBasedLoggerSettings.cs

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/Simplify.Log/Settings/LoggerSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class LoggerSettings : ILoggerSettings
2828
public const LoggerPathType DefaultPathType = LoggerPathType.Relative;
2929

3030
/// <summary>
31-
/// Initializes a new instance of the <see cref="ConfigurationManagerBasedLoggerSettings"/> class.
31+
/// Initializes a new instance of the <see cref="LoggerSettings"/> class.
3232
/// </summary>
3333
/// <param name="maxFileSize">Maximum size of the file.</param>
3434
/// <param name="fileName">Name of the file.</param>
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net462</TargetFrameworks>
4-
<OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
3+
<TargetFrameworks>net50;netstandard2.0</TargetFrameworks>
4+
<LangVersion>9.0</LangVersion>
55
<OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
66
<EmbedUntrackedSources>true</EmbedUntrackedSources>
77
<IncludeSymbols>true</IncludeSymbols>
88
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010

11-
<Version>1.6.2</Version>
12-
<PackageReleaseNotes>
13-
Updates
14-
* Upgrade to Microsoft.Extensions.Configuration 3.1.*
15-
* Upgrade to System.IO.Abstractions 13.2.*
16-
</PackageReleaseNotes>
11+
<Version>2.0</Version>
1712

1813
<Authors>Alexander Krylkov</Authors>
1914
<Product>Simplify</Product>
@@ -23,15 +18,15 @@
2318
<PackageIcon>icon.png</PackageIcon>
2419
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2520
<PackageTags>.NET logger</PackageTags>
21+
22+
<PackageReleaseNotes>See https://github.com/SimplifyNet/Simplify/tree/master/src/Simplify.Log/CHANGELOG.md for details</PackageReleaseNotes>
2623
</PropertyGroup>
2724
<ItemGroup>
28-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.*" />
29-
<PackageReference Include="System.IO.Abstractions" Version="13.2.*" />
30-
<Reference Include="System.Configuration" />
31-
<Reference Include="System.ServiceModel" />
32-
<Reference Include="System.Web" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
26+
<PackageReference Include="System.IO.Abstractions" Version="13.2.47" />
3327
</ItemGroup>
3428
<ItemGroup>
3529
<None Include="..\..\images\icon.png" Pack="true" Visible="false" PackagePath="" />
30+
<None Include="CHANGELOG.md" Pack="true" PackagePath="\" />
3631
</ItemGroup>
3732
</Project>

0 commit comments

Comments
 (0)