Updated packages
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
net7.0;
|
net7.0;
|
||||||
</TargetFrameworks>
|
</TargetFrameworks>
|
||||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||||
<Version>1.0.8</Version>
|
<Version>1.0.9</Version>
|
||||||
<Authors>EonaCat (Jeroen Saey)</Authors>
|
<Authors>EonaCat (Jeroen Saey)</Authors>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Company>EonaCat (Jeroen Saey)</Company>
|
<Company>EonaCat (Jeroen Saey)</Company>
|
||||||
@@ -46,8 +46,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ namespace EonaCat.Logger.Managers
|
|||||||
|
|
||||||
public partial class LogManager : ILogManager, IDisposable
|
public partial class LogManager : ILogManager, IDisposable
|
||||||
{
|
{
|
||||||
private readonly object _batton = new object();
|
|
||||||
private DateTime _logDate;
|
private DateTime _logDate;
|
||||||
public ELogType LogType;
|
public ELogType LogType;
|
||||||
private ILoggerProvider LoggerProvider { get; set; }
|
private ILoggerProvider LoggerProvider { get; set; }
|
||||||
@@ -77,21 +76,18 @@ namespace EonaCat.Logger.Managers
|
|||||||
|
|
||||||
protected virtual void Dispose(bool disposing)
|
protected virtual void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
lock (this)
|
if (_disposed)
|
||||||
{
|
{
|
||||||
if (_disposed)
|
return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disposing)
|
|
||||||
{
|
|
||||||
StopLogging();
|
|
||||||
_TokenSource.Cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
_disposed = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
StopLogging();
|
||||||
|
_TokenSource.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
_disposed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartNewLog()
|
private void StartNewLog()
|
||||||
@@ -295,32 +291,26 @@ namespace EonaCat.Logger.Managers
|
|||||||
|
|
||||||
public void Write(string message, ELogType logType = ELogType.INFO, bool? writeToConsole = null)
|
public void Write(string message, ELogType logType = ELogType.INFO, bool? writeToConsole = null)
|
||||||
{
|
{
|
||||||
lock (_batton)
|
if (logType == ELogType.NONE)
|
||||||
{
|
{
|
||||||
if (logType == ELogType.NONE)
|
return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DateTime now = DateTime.Now;
|
|
||||||
|
|
||||||
if (!IsRunning)
|
|
||||||
{
|
|
||||||
StartNewLog();
|
|
||||||
}
|
|
||||||
|
|
||||||
Write(now, message, logType, writeToConsole);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DateTime now = DateTime.Now;
|
||||||
|
|
||||||
|
if (!IsRunning)
|
||||||
|
{
|
||||||
|
StartNewLog();
|
||||||
|
}
|
||||||
|
|
||||||
|
Write(now, message, logType, writeToConsole);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteCurrentLogFile()
|
public void DeleteCurrentLogFile()
|
||||||
{
|
{
|
||||||
lock (this)
|
if (!string.IsNullOrWhiteSpace(CurrentLogFile))
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(CurrentLogFile))
|
File.Delete(CurrentLogFile);
|
||||||
{
|
|
||||||
File.Delete(CurrentLogFile);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user