forked from serilog/serilog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try and set the log source if it's specified
- Loading branch information
1 parent
3221a70
commit 3a698bb
Showing
4 changed files
with
186 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
namespace Serilog.Tests.Support | ||
{ | ||
public class DelegateDisposable : IDisposable | ||
{ | ||
private readonly Action _disposeAction; | ||
private bool _disposed; | ||
|
||
public DelegateDisposable(Action disposeAction) | ||
{ | ||
_disposeAction = disposeAction; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
if (_disposed) | ||
return; | ||
|
||
_disposeAction(); | ||
_disposed = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Serilog.Core; | ||
using Serilog.Events; | ||
|
||
namespace Serilog.Tests.Support | ||
{ | ||
public class DisposableLogger : ILogger, IDisposable | ||
{ | ||
public bool Disposed { get; set; } | ||
|
||
public void Dispose() | ||
{ | ||
Disposed = true; | ||
} | ||
|
||
public ILogger ForContext(IEnumerable<ILogEventEnricher> enrichers) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public ILogger ForContext(string propertyName, object value, bool destructureObjects = false) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public ILogger ForContext<TSource>() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public ILogger ForContext(Type source) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Write(LogEvent logEvent) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Write(LogEventLevel level, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Write(LogEventLevel level, Exception exception, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public bool IsEnabled(LogEventLevel level) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Verbose(string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Verbose(Exception exception, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Debug(string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Debug(Exception exception, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Information(string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Information(Exception exception, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Warning(string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Warning(Exception exception, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Error(string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Error(Exception exception, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Fatal(string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Fatal(Exception exception, string messageTemplate, params object[] propertyValues) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |