Skip to content

Commit 597aecd

Browse files
(#171) Rename to GetLogs
1 parent c069f1e commit 597aecd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Stravaig.Extensions.Logging.Diagnostics/TestCaptureLogger.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public IReadOnlyList<LogEntry> GetLogs(Func<LogEntry, bool> predicate)
6161
}
6262
}
6363

64-
6564
/// <inheritdoc />
6665
public IReadOnlyList<LogEntry> GetLogEntriesWithExceptions()
6766
=> GetLogs(log => log.Exception != null);

src/Stravaig.Extensions.Logging.Diagnostics/TestCaptureLoggerProvider.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public IReadOnlyList<LogEntry> GetAllLogEntries()
107107
/// they were logged as.
108108
/// </summary>
109109
/// <returns>A read only list of <see cref="LogEntry"/> objects.</returns>
110-
public IReadOnlyList<LogEntry> GetLogEntriesMatchingPredicate(Func<LogEntry, bool> predicate)
110+
public IReadOnlyList<LogEntry> GetLogs(Func<LogEntry, bool> predicate)
111111
{
112112
var loggers = _captures.Values;
113113
var allLogs = loggers.SelectMany(l => l.GetLogs(predicate)).ToList();
@@ -122,7 +122,7 @@ public IReadOnlyList<LogEntry> GetLogEntriesMatchingPredicate(Func<LogEntry, boo
122122
/// </summary>
123123
/// <returns>A read only list of <see cref="LogEntry"/> objects.</returns>
124124
public IReadOnlyList<LogEntry> GetAllLogEntriesWithExceptions()
125-
=> GetLogEntriesMatchingPredicate(static log => log.Exception != null);
125+
=> GetLogs(static log => log.Exception != null);
126126

127127
/// <summary>
128128
/// Resets the captures to an empty state.
@@ -140,6 +140,8 @@ public void Reset()
140140
/// </summary>
141141
public void Dispose()
142142
{
143-
Reset();
143+
_captures.Clear();
144+
_typedCaptures.Clear();
145+
GC.SuppressFinalize(this);
144146
}
145147
}

0 commit comments

Comments
 (0)