mirror of
https://github.com/Ellpeck/ExtremelySimpleLogger.git
synced 2024-11-21 17:53:28 +01:00
Added IsEnabled to sink and update
This commit is contained in:
parent
6b500ec693
commit
cd10c083bf
2 changed files with 5 additions and 1 deletions
|
@ -45,7 +45,7 @@ namespace ExtremelySimpleLogger {
|
|||
if (!this.IsEnabled || level < this.MinimumLevel)
|
||||
return;
|
||||
foreach (var sink in this.Sinks) {
|
||||
if (level >= sink.MinimumLevel)
|
||||
if (sink.IsEnabled && level >= sink.MinimumLevel)
|
||||
sink.Log(this, level, message, e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ namespace ExtremelySimpleLogger {
|
|||
/// By default, <see cref="FormatDefault"/> is used.
|
||||
/// </summary>
|
||||
public LogFormatter Formatter { get; set; }
|
||||
/// <summary>
|
||||
/// If this property is set to <code>false</code>, this sink will not log any messages.
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new sink with the default settings.
|
||||
|
|
Loading…
Reference in a new issue