diff --git a/Logging/Logger.cs b/Logging/Logger.cs index 9ca3d28..f250d5b 100644 --- a/Logging/Logger.cs +++ b/Logging/Logger.cs @@ -20,7 +20,7 @@ public class Logger : TextWriter this.Encoding = encoding ?? Encoding.ASCII; if (enabledLoggers.Contains(LoggerType.FileLogger) && logFilePath is not null) _fileLogger = new FileLogger(logFilePath, encoding); - else + else if(enabledLoggers.Contains(LoggerType.FileLogger) && logFilePath is null) { _fileLogger = null; throw new ArgumentException($"logFilePath can not be null for LoggerType {LoggerType.FileLogger}");