mirror of
https://github.com/Ellpeck/ExtremelySimpleLogger.git
synced 2024-11-22 10:03:29 +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)
|
if (!this.IsEnabled || level < this.MinimumLevel)
|
||||||
return;
|
return;
|
||||||
foreach (var sink in this.Sinks) {
|
foreach (var sink in this.Sinks) {
|
||||||
if (level >= sink.MinimumLevel)
|
if (sink.IsEnabled && level >= sink.MinimumLevel)
|
||||||
sink.Log(this, level, message, e);
|
sink.Log(this, level, message, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,10 @@ namespace ExtremelySimpleLogger {
|
||||||
/// By default, <see cref="FormatDefault"/> is used.
|
/// By default, <see cref="FormatDefault"/> is used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public LogFormatter Formatter { get; set; }
|
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>
|
/// <summary>
|
||||||
/// Initializes a new sink with the default settings.
|
/// Initializes a new sink with the default settings.
|
||||||
|
|
Loading…
Reference in a new issue