Fixed missing filelogger crash
This commit is contained in:
parent
a4aa571870
commit
11461051f3
@ -20,7 +20,7 @@ public class Logger : TextWriter
|
|||||||
this.Encoding = encoding ?? Encoding.ASCII;
|
this.Encoding = encoding ?? Encoding.ASCII;
|
||||||
if (enabledLoggers.Contains(LoggerType.FileLogger) && logFilePath is not null)
|
if (enabledLoggers.Contains(LoggerType.FileLogger) && logFilePath is not null)
|
||||||
_fileLogger = new FileLogger(logFilePath, encoding);
|
_fileLogger = new FileLogger(logFilePath, encoding);
|
||||||
else
|
else if(enabledLoggers.Contains(LoggerType.FileLogger) && logFilePath is null)
|
||||||
{
|
{
|
||||||
_fileLogger = null;
|
_fileLogger = null;
|
||||||
throw new ArgumentException($"logFilePath can not be null for LoggerType {LoggerType.FileLogger}");
|
throw new ArgumentException($"logFilePath can not be null for LoggerType {LoggerType.FileLogger}");
|
||||||
|
Loading…
Reference in New Issue
Block a user