mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-25 02:21:00 +01:00
public event NotifyCollectionChangedEventHandler LogEntriesChanged (#355)
This commit is contained in:
@@ -19,7 +19,21 @@ namespace WireMock.Server
|
||||
[PublicAPI]
|
||||
public event NotifyCollectionChangedEventHandler LogEntriesChanged
|
||||
{
|
||||
add => _options.LogEntries.CollectionChanged += value;
|
||||
add
|
||||
{
|
||||
_options.LogEntries.CollectionChanged += (sender, eventRecordArgs) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
value(sender, eventRecordArgs);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
_options.Logger.Error("Error calling the LogEntriesChanged event handler: {0}", exception.Message);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
remove => _options.LogEntries.CollectionChanged -= value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user