20 lines
661 B
C#
20 lines
661 B
C#
using System.Collections.Generic;
|
|
using MxGateway.Worker.Bootstrap;
|
|
|
|
namespace MxGateway.Worker.Tests.Bootstrap;
|
|
|
|
internal sealed class MemoryWorkerLogger : IWorkerLogger
|
|
{
|
|
public List<MemoryWorkerLogEntry> Entries { get; } = new();
|
|
|
|
public void Information(string eventName, IReadOnlyDictionary<string, object?> fields)
|
|
{
|
|
Entries.Add(new MemoryWorkerLogEntry("Information", eventName, WorkerLogRedactor.RedactFields(fields)));
|
|
}
|
|
|
|
public void Error(string eventName, IReadOnlyDictionary<string, object?> fields)
|
|
{
|
|
Entries.Add(new MemoryWorkerLogEntry("Error", eventName, WorkerLogRedactor.RedactFields(fields)));
|
|
}
|
|
}
|