ScopedLogger with implicit member name

Include NetStandard in NetCore
This commit is contained in:
2024-08-22 13:21:45 +02:00
parent ec343797b4
commit a8de6cd15d
4 changed files with 292 additions and 8 deletions
@@ -0,0 +1,17 @@
using Microsoft.Extensions.Logging;
using System.Logging;
using System.Runtime.CompilerServices;
namespace System.Extensions.Core;
public static class LoggingExtensions
{
public static ScopedLogger<T> CreateScopedLogger<T>(this ILogger<T> logger, string flowIdentifier, [CallerMemberName] string? methodName = default)
{
return ScopedLogger<T>.Create(logger, methodName ?? string.Empty, flowIdentifier);
}
public static ScopedLogger<T> CreateScopedLogger<T>(this ILogger<T> logger, [CallerMemberName] string? methodName = default)
{
return ScopedLogger<T>.Create(logger, methodName ?? string.Empty, string.Empty);
}
}