mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-01 06:33:11 +02:00
Log Exception (#405)
This commit is contained in:
@@ -36,12 +36,27 @@ namespace WireMock.Logging
|
||||
Console.WriteLine(Format("Warn", formatString, args));
|
||||
}
|
||||
|
||||
/// <see cref="IWireMockLogger.Error"/>
|
||||
/// <see cref="IWireMockLogger.Error(string, object[])"/>
|
||||
public void Error(string formatString, params object[] args)
|
||||
{
|
||||
Console.WriteLine(Format("Error", formatString, args));
|
||||
}
|
||||
|
||||
/// <see cref="IWireMockLogger.Error(string, Exception)"/>
|
||||
public void Error(string formatString, Exception exception)
|
||||
{
|
||||
Console.WriteLine(Format("Error", formatString, exception.Message));
|
||||
|
||||
if (exception is AggregateException ae)
|
||||
{
|
||||
ae.Handle(ex =>
|
||||
{
|
||||
Console.WriteLine(Format("Error", "Exception {0}", exception.Message));
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <see cref="IWireMockLogger.DebugRequestResponse"/>
|
||||
public void DebugRequestResponse(LogEntryModel logEntryModel, bool isAdminRequest)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using WireMock.Admin.Requests;
|
||||
using System;
|
||||
using WireMock.Admin.Requests;
|
||||
|
||||
namespace WireMock.Logging
|
||||
{
|
||||
@@ -26,12 +27,18 @@ namespace WireMock.Logging
|
||||
// Log nothing
|
||||
}
|
||||
|
||||
/// <see cref="IWireMockLogger.Error"/>
|
||||
/// <see cref="IWireMockLogger.Error(string, object[])"/>
|
||||
public void Error(string formatString, params object[] args)
|
||||
{
|
||||
// Log nothing
|
||||
}
|
||||
|
||||
/// <see cref="IWireMockLogger.Error(string, Exception)"/>
|
||||
public void Error(string formatString, Exception exception)
|
||||
{
|
||||
// Log nothing
|
||||
}
|
||||
|
||||
/// <see cref="IWireMockLogger.DebugRequestResponse"/>
|
||||
public void DebugRequestResponse(LogEntryModel logEntryModel, bool isAdminRequest)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user