removed dtlib internal logging
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<!--package info-->
|
||||
<PackageId>DTLib.Logging</PackageId>
|
||||
<Version>1.3.0</Version>
|
||||
<Version>1.3.1</Version>
|
||||
<Authors>Timerix</Authors>
|
||||
<Description>Loggers with dependency injection</Description>
|
||||
<RepositoryType>GIT</RepositoryType>
|
||||
@@ -11,7 +11,7 @@
|
||||
<Configuration>Release</Configuration>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<!--compilation properties-->
|
||||
<TargetFrameworks>netstandard2.0;net48;net6.0;net7.0</TargetFrameworks>
|
||||
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<DebugType>embedded</DebugType>
|
||||
<!--language features-->
|
||||
<LangVersion>10</LangVersion>
|
||||
@@ -30,7 +30,7 @@
|
||||
<ProjectReference Include="..\DTLib.Ben.Demystifier\DTLib.Ben.Demystifier.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
|
||||
<PackageReference Include="DTLib" Version="1.3.0" />
|
||||
<PackageReference Include="DTLib" Version="1.3.1" />
|
||||
<PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
global using System;
|
||||
global using System.Collections;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Runtime.CompilerServices;
|
||||
global using System.Linq;
|
||||
global using System.Text;
|
||||
global using System.Threading.Tasks;
|
||||
global using DTLib.Extensions;
|
||||
global using DTLib.Filesystem;
|
||||
|
||||
namespace DTLib.Logging;
|
||||
|
||||
/// this class can be used to setup logger for DTLib debug log messages
|
||||
public static class DTLibInternalLogging
|
||||
{
|
||||
private static ContextLogger _loggerContext;
|
||||
|
||||
public static void SetLogger(ILogger logger)
|
||||
{
|
||||
_loggerContext = new ContextLogger("DTLib",logger);
|
||||
InternalLog.LogEvent+=LogHandler;
|
||||
}
|
||||
|
||||
private static void LogHandler(string[] msg)
|
||||
{
|
||||
if (msg.Length == 1)
|
||||
{
|
||||
_loggerContext.LogDebug(msg[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder b = new();
|
||||
for (int i = 1; i < msg.Length; i++)
|
||||
b.Append(msg[i]);
|
||||
_loggerContext.LogDebug(b.ToString());
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
using DTLib.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
|
||||
|
||||
8
DTLib.Logging/GlobalUsings.cs
Normal file
8
DTLib.Logging/GlobalUsings.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Runtime.CompilerServices;
|
||||
global using System.Linq;
|
||||
global using System.Text;
|
||||
global using System.Threading.Tasks;
|
||||
global using DTLib.Extensions;
|
||||
global using DTLib.Filesystem;
|
||||
Reference in New Issue
Block a user