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()); } }