diff --git a/GlaxLogger/GlaxLogger.csproj b/GlaxLogger/GlaxLogger.csproj
index 12509a3..1d43d68 100644
--- a/GlaxLogger/GlaxLogger.csproj
+++ b/GlaxLogger/GlaxLogger.csproj
@@ -7,7 +7,7 @@
Glax
https://git.bernloehr.eu/glax/GlaxLogger
git
- 1.0.3
+ 1.0.4
diff --git a/GlaxLogger/Logger.cs b/GlaxLogger/Logger.cs
index f879ca4..8c6826f 100644
--- a/GlaxLogger/Logger.cs
+++ b/GlaxLogger/Logger.cs
@@ -5,13 +5,12 @@ namespace GlaxLogger;
public class Logger : ILogger, IDisposable, IAsyncDisposable
{
- private readonly LogLevel _filterLevel;
+ private LogLevel _filterLevel;
private readonly FileStream _allMessageLogfile, _filteredLogfile;
private readonly ConsoleColor _defaultForegroundColor = Console.ForegroundColor;
private readonly ConsoleColor _defaultBackgroundColor = Console.BackgroundColor;
private readonly TextWriter _consoleOut;
-
public Logger(LogLevel filteredLevel = LogLevel.Warning, string? outputFolderPath = null, TextWriter? consoleOut = null)
{
this._filterLevel = filteredLevel;
@@ -46,6 +45,12 @@ public class Logger : ILogger, IDisposable, IAsyncDisposable
return logLevel >= _filterLevel;
}
+ public void UpdateLogLevel(LogLevel filterLevel)
+ {
+ this._filterLevel = filterLevel;
+ Log(LogLevel.None, new EventId(), $"Change LogLevel to {filterLevel}", null, (s, exception) => s);
+ }
+
public IDisposable? BeginScope(TState state) where TState : notnull
{
return null;