17 lines
406 B
C#
17 lines
406 B
C#
using Microsoft.Extensions.Logging;
|
|
|
|
namespace MxGateway.Server.Diagnostics;
|
|
|
|
public static class GatewayLoggerExtensions
|
|
{
|
|
public static IDisposable? BeginGatewayScope(
|
|
this ILogger logger,
|
|
GatewayLogScope scope)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(logger);
|
|
ArgumentNullException.ThrowIfNull(scope);
|
|
|
|
return logger.BeginScope(scope.ToDictionary());
|
|
}
|
|
}
|