Updated packages
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
net7.0;
|
||||
</TargetFrameworks>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<Version>1.0.8</Version>
|
||||
<Version>1.0.9</Version>
|
||||
<Authors>EonaCat (Jeroen Saey)</Authors>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Company>EonaCat (Jeroen Saey)</Company>
|
||||
@@ -46,8 +46,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace EonaCat.Logger.Managers
|
||||
|
||||
public partial class LogManager : ILogManager, IDisposable
|
||||
{
|
||||
private readonly object _batton = new object();
|
||||
private DateTime _logDate;
|
||||
public ELogType LogType;
|
||||
private ILoggerProvider LoggerProvider { get; set; }
|
||||
@@ -30,7 +29,7 @@ namespace EonaCat.Logger.Managers
|
||||
public bool IsRunning { get; private set; }
|
||||
|
||||
public StreamWriter Output { get; private set; }
|
||||
|
||||
|
||||
public string CategoryName { get; set; }
|
||||
|
||||
public readonly string Id;
|
||||
@@ -77,21 +76,18 @@ namespace EonaCat.Logger.Managers
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
lock (this)
|
||||
if (_disposed)
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
StopLogging();
|
||||
_TokenSource.Cancel();
|
||||
}
|
||||
|
||||
_disposed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
StopLogging();
|
||||
_TokenSource.Cancel();
|
||||
}
|
||||
|
||||
_disposed = true;
|
||||
}
|
||||
|
||||
private void StartNewLog()
|
||||
@@ -184,10 +180,10 @@ namespace EonaCat.Logger.Managers
|
||||
Write(dateTime, remainder, logType, writeToConsole);
|
||||
}
|
||||
|
||||
var EonaCatMessage = new EonaCatLogMessage
|
||||
var EonaCatMessage = new EonaCatLogMessage
|
||||
{
|
||||
DateTime = dateTime,
|
||||
Message = currentMessage,
|
||||
DateTime = dateTime,
|
||||
Message = currentMessage,
|
||||
LogType = logType
|
||||
};
|
||||
|
||||
@@ -235,7 +231,7 @@ namespace EonaCat.Logger.Managers
|
||||
}
|
||||
|
||||
if (!settings.EnableFileLogging) return;
|
||||
|
||||
|
||||
if (logFolder != null)
|
||||
{
|
||||
Settings.FileLoggerOptions.LogDirectory = logFolder;
|
||||
@@ -295,32 +291,26 @@ namespace EonaCat.Logger.Managers
|
||||
|
||||
public void Write(string message, ELogType logType = ELogType.INFO, bool? writeToConsole = null)
|
||||
{
|
||||
lock (_batton)
|
||||
if (logType == ELogType.NONE)
|
||||
{
|
||||
if (logType == ELogType.NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
if (!IsRunning)
|
||||
{
|
||||
StartNewLog();
|
||||
}
|
||||
|
||||
Write(now, message, logType, writeToConsole);
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
if (!IsRunning)
|
||||
{
|
||||
StartNewLog();
|
||||
}
|
||||
|
||||
Write(now, message, logType, writeToConsole);
|
||||
}
|
||||
|
||||
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