Updated
This commit is contained in:
@@ -20,7 +20,5 @@
|
|||||||
internal static string VERSION_NAME { get; }
|
internal static string VERSION_NAME { get; }
|
||||||
|
|
||||||
public static string ApplicationName { get; internal set; } = "EonaCatLogger";
|
public static string ApplicationName { get; internal set; } = "EonaCatLogger";
|
||||||
|
|
||||||
public static ELogType LogLevel { get; internal set; } = ELogType.INFO;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
net7.0;
|
net7.0;
|
||||||
</TargetFrameworks>
|
</TargetFrameworks>
|
||||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||||
<Version>1.0.6</Version>
|
<Version>1.0.7</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>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using EonaCat.Logger.Managers;
|
|||||||
using EonaCatLogger.EonaCatCoreLogger.Models;
|
using EonaCatLogger.EonaCatCoreLogger.Models;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime;
|
|
||||||
|
|
||||||
namespace EonaCat.Logger.Internal
|
namespace EonaCat.Logger.Internal
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
{
|
{
|
||||||
public interface ILogManager
|
public interface ILogManager
|
||||||
{
|
{
|
||||||
void Write(string message, ELogType logType = ELogType.INFO, ELogType? logLevel = null, bool? writeToConsole = null);
|
void Write(string message, ELogType logType = ELogType.INFO, bool? writeToConsole = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,34 +290,26 @@ namespace EonaCat.Logger.Managers
|
|||||||
public void Write(Exception exception, string module = null, string method = null, bool criticalException = false, bool? writeToConsole = null)
|
public void Write(Exception exception, string module = null, string method = null, bool criticalException = false, bool? writeToConsole = null)
|
||||||
{
|
{
|
||||||
if (exception == null) return;
|
if (exception == null) return;
|
||||||
Write(exception.FormatExceptionToMessage(module, method), criticalException ? ELogType.CRITICAL : ELogType.ERROR, null, writeToConsole);
|
Write(exception.FormatExceptionToMessage(module, method), criticalException ? ELogType.CRITICAL : ELogType.ERROR, writeToConsole);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(string message, ELogType logType = ELogType.INFO, ELogType? logLevel = null, bool? writeToConsole = null)
|
public void Write(string message, ELogType logType = ELogType.INFO, bool? writeToConsole = null)
|
||||||
{
|
{
|
||||||
lock (_batton)
|
lock (_batton)
|
||||||
{
|
{
|
||||||
if (logLevel == null)
|
|
||||||
{
|
|
||||||
logLevel = DllInfo.LogLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logType == ELogType.NONE)
|
if (logType == ELogType.NONE)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logType == ELogType.CRITICAL || logType <= logLevel.GetValueOrDefault())
|
DateTime now = DateTime.Now;
|
||||||
|
|
||||||
|
if (!IsRunning)
|
||||||
{
|
{
|
||||||
DateTime now = DateTime.Now;
|
StartNewLog();
|
||||||
|
|
||||||
if (!IsRunning)
|
|
||||||
{
|
|
||||||
StartNewLog();
|
|
||||||
}
|
|
||||||
|
|
||||||
Write(now, message, logType, writeToConsole);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write(now, message, logType, writeToConsole);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user