DTLib.Logging.Microsoft and dependency upgrade

This commit is contained in:
Timerix22 2024-01-07 14:11:35 +06:00
parent b12fdb2280
commit ea03818fe4
10 changed files with 69 additions and 66 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib.Dtsod</PackageId> <PackageId>DTLib.Dtsod</PackageId>
<Version>1.3.2</Version> <Version>1.3.3</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Definitely not json</Description> <Description>Definitely not json</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>
@ -20,10 +20,6 @@
</PropertyGroup> </PropertyGroup>
<!--external dependencies--> <!--external dependencies-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Dynamic" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup> </ItemGroup>
@ -33,7 +29,7 @@
<ProjectReference Include="..\DTLib\DTLib.csproj" /> <ProjectReference Include="..\DTLib\DTLib.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.3.2" /> <PackageReference Include="DTLib" Version="1.3.3" />
</ItemGroup> </ItemGroup>
<!--project files--> <!--project files-->

View File

@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--package info-->
<PackageId>DTLib.Logging.Microsoft</PackageId>
<Version>1.0.0</Version>
<Authors>Timerix</Authors>
<Description>DTLib logger wrapper with dependency injection</Description>
<RepositoryType>GIT</RepositoryType>
<RepositoryUrl>https://github.com/Timerix22/DTLib</RepositoryUrl>
<PackageProjectUrl>https://github.com/Timerix22/DTLib</PackageProjectUrl>
<Configuration>Release</Configuration>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!--compilation properties-->
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<DebugType>embedded</DebugType>
<!--language features-->
<LangVersion>12</LangVersion>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>
<!--external dependencies-->
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>
<!--DTLib dependencies-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<ProjectReference Include="..\DTLib.Logging\DTLib.Logging.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib.Logging" Version="1.3.3" />
</ItemGroup>
</Project>

View File

@ -1,12 +1,12 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace DTLib.Logging.DependencyInjection; namespace DTLib.Logging.Microsoft;
public class LoggerService<TCaller> : ServiceDescriptor public class LoggerService<TCaller> : ServiceDescriptor
{ {
// ReSharper disable once RedundantNameQualifier // ReSharper disable once RedundantNameQualifier
public LoggerService(DTLib.Logging.ILogger logger) : base( public LoggerService(DTLib.Logging.ILogger logger) : base(
typeof(Microsoft.Extensions.Logging.ILogger<TCaller>), typeof(global::Microsoft.Extensions.Logging.ILogger<TCaller>),
new MyLoggerWrapper<TCaller>(logger)) new MyLoggerWrapper<TCaller>(logger))
{ {
} }

View File

@ -1,9 +1,12 @@
using Microsoft.Extensions.Logging;
// ReSharper disable RedundantNameQualifier // ReSharper disable RedundantNameQualifier
namespace DTLib.Logging.DependencyInjection; using System;
using Microsoft.Extensions.Logging;
public class MyLoggerWrapper<TCaller> : Microsoft.Extensions.Logging.ILogger<TCaller> namespace DTLib.Logging.Microsoft;
public class MyLoggerWrapper<TCaller> : global::Microsoft.Extensions.Logging.ILogger<TCaller>
{ {
public DTLib.Logging.ILogger Logger; public DTLib.Logging.ILogger Logger;
public MyLoggerWrapper(DTLib.Logging.ILogger logger)=> public MyLoggerWrapper(DTLib.Logging.ILogger logger)=>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib.Logging</PackageId> <PackageId>DTLib.Logging</PackageId>
<Version>1.3.2</Version> <Version>1.3.3</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Loggers with dependency injection</Description> <Description>Loggers with dependency injection</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>
@ -14,23 +14,18 @@
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<!--language features--> <!--language features-->
<LangVersion>10</LangVersion> <LangVersion>12</LangVersion>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<!--external dependencies-->
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
</ItemGroup>
<!--DTLib dependencies--> <!--DTLib dependencies-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<ProjectReference Include="..\DTLib\DTLib.csproj" /> <ProjectReference Include="..\DTLib\DTLib.csproj" />
<ProjectReference Include="..\DTLib.Ben.Demystifier\DTLib.Ben.Demystifier.csproj" /> <ProjectReference Include="..\DTLib.Ben.Demystifier\DTLib.Ben.Demystifier.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.3.2" /> <PackageReference Include="DTLib" Version="1.3.3" />
<PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.5" /> <PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.6" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib.Network</PackageId> <PackageId>DTLib.Network</PackageId>
<Version>1.3.4</Version> <Version>1.4.0</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Some sick network protocols</Description> <Description>Some sick network protocols</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>
@ -14,24 +14,16 @@
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<!--language features--> <!--language features-->
<LangVersion>10</LangVersion> <LangVersion>12</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<!--external dependencies-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<!--DTLib dependencies--> <!--DTLib dependencies-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<ProjectReference Include="..\DTLib\DTLib.csproj" />
<ProjectReference Include="..\DTLib.Dtsod\DTLib.Dtsod.csproj" /> <ProjectReference Include="..\DTLib.Dtsod\DTLib.Dtsod.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib.Dtsod" Version="1.3.2" /> <PackageReference Include="DTLib.Dtsod" Version="1.3.3" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -5,19 +5,11 @@
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<!--language features--> <!--language features-->
<LangVersion>10</LangVersion> <LangVersion>12</LangVersion>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<!--external dependencies-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Dynamic" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<!--DTLib dependencies--> <!--DTLib dependencies-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -27,10 +19,10 @@
<ProjectReference Include="..\DTLib\DTLib.csproj" /> <ProjectReference Include="..\DTLib\DTLib.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.3.2" /> <PackageReference Include="DTLib" Version="1.3.3" />
<PackageReference Include="DTLib.Dtsod" Version="1.3.2" /> <PackageReference Include="DTLib.Dtsod" Version="1.3.3" />
<PackageReference Include="DTLib.Network" Version="1.3.4" /> <PackageReference Include="DTLib.Network" Version="1.4.0" />
<PackageReference Include="DTLib.Logging" Version="1.3.2" /> <PackageReference Include="DTLib.Logging" Version="1.3.3" />
</ItemGroup> </ItemGroup>
<!--project files--> <!--project files-->

View File

@ -28,6 +28,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KerepWrapper", "KerepWrapper\KerepWrapper.csproj", "{9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KerepWrapper", "KerepWrapper\KerepWrapper.csproj", "{9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTLib.Logging.Microsoft", "DTLib.Logging.Microsoft\DTLib.Logging.Microsoft.csproj", "{9CCBAFA1-F191-4CEC-A4FA-CFF9F6CA081F}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -75,6 +77,12 @@ Global
{9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}.Release|Any CPU.ActiveCfg = Release|Any CPU {9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}.Release|Any CPU.Build.0 = Release|Any CPU {9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}.Release|Any CPU.Build.0 = Release|Any CPU
{9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}.Publish|Any CPU.ActiveCfg = Debug|Any CPU {9ADC4AA1-1DE4-4BB6-AF38-E84C1A142032}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
{9CCBAFA1-F191-4CEC-A4FA-CFF9F6CA081F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CCBAFA1-F191-4CEC-A4FA-CFF9F6CA081F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CCBAFA1-F191-4CEC-A4FA-CFF9F6CA081F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9CCBAFA1-F191-4CEC-A4FA-CFF9F6CA081F}.Release|Any CPU.Build.0 = Release|Any CPU
{9CCBAFA1-F191-4CEC-A4FA-CFF9F6CA081F}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
{9CCBAFA1-F191-4CEC-A4FA-CFF9F6CA081F}.Publish|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib</PackageId> <PackageId>DTLib</PackageId>
<Version>1.3.2</Version> <Version>1.3.3</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Library for all my C# projects</Description> <Description>Library for all my C# projects</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>
@ -12,25 +12,15 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<!--compilation properties--> <!--compilation properties-->
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<!--Platforms>AnyCPU;x64;x86;arm64</Platforms-->
<!--Configurations>Debug;Release</Configurations-->
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<!--language features--> <!--language features-->
<LangVersion>10</LangVersion> <LangVersion>12</LangVersion>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<!--external dependencies-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Dynamic" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<!--project files--> <!--project files-->
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<Compile Remove="Experimental\**" /> <Compile Remove="Experimental\**" />
@ -38,7 +28,4 @@
<ItemGroup> <ItemGroup>
<Compile Remove="Experimental\ConsoleGUI\**" /> <Compile Remove="Experimental\ConsoleGUI\**" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Logging\" />
</ItemGroup>
</Project> </Project>

View File

@ -15,16 +15,12 @@
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<!--language features--> <!--language features-->
<LangVersion>10</LangVersion> <LangVersion>12</LangVersion>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<!--external dependencies--> <!--external dependencies-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Dynamic" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup> </ItemGroup>
@ -35,8 +31,8 @@
<ProjectReference Include="..\DTLib.Dtsod\DTLib.Dtsod.csproj" /> <ProjectReference Include="..\DTLib.Dtsod\DTLib.Dtsod.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.3.2" /> <PackageReference Include="DTLib" Version="1.3.3" />
<PackageReference Include="DTLib.Dtsod" Version="1.3.2" /> <PackageReference Include="DTLib.Dtsod" Version="1.3.3" />
</ItemGroup> </ItemGroup>
<!--project files--> <!--project files-->