debug log enabled in DEBUG configuration

This commit is contained in:
timerix 2022-12-05 19:04:31 +06:00
parent a9c0e1172f
commit 58459c4d11
3 changed files with 18 additions and 3 deletions

View File

@ -52,7 +52,12 @@ public class CompositeLogger : ILogger
public ILogFormat Format { get; } public ILogFormat Format { get; }
protected ILogger[] _loggers; protected ILogger[] _loggers;
private bool _debugLogEnabled = false; private bool _debugLogEnabled =
#if DEBUG
true;
#else
false;
#endif
private bool _infoLogEnabled = true; private bool _infoLogEnabled = true;
private bool _warnLogEnabled = true; private bool _warnLogEnabled = true;
private bool _errorLogenabled = true; private bool _errorLogenabled = true;

View File

@ -3,7 +3,12 @@
// вывод лога в консоль и файл // вывод лога в консоль и файл
public class ConsoleLogger : ILogger public class ConsoleLogger : ILogger
{ {
public bool DebugLogEnabled { get; set; } = false; public bool DebugLogEnabled { get; set; } =
#if DEBUG
true;
#else
false;
#endif
public bool InfoLogEnabled { get; set; } = true; public bool InfoLogEnabled { get; set; } = true;
public bool WarnLogEnabled { get; set; } = true; public bool WarnLogEnabled { get; set; } = true;
public bool ErrorLogenabled { get; set; } = true; public bool ErrorLogenabled { get; set; } = true;

View File

@ -2,7 +2,12 @@
public class FileLogger : ILogger public class FileLogger : ILogger
{ {
public bool DebugLogEnabled { get; set; } = false; public bool DebugLogEnabled { get; set; } =
#if DEBUG
true;
#else
false;
#endif
public bool InfoLogEnabled { get; set; } = true; public bool InfoLogEnabled { get; set; } = true;
public bool WarnLogEnabled { get; set; } = true; public bool WarnLogEnabled { get; set; } = true;
public bool ErrorLogenabled { get; set; } = true; public bool ErrorLogenabled { get; set; } = true;