mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-20 16:29:28 +00:00
ScopedLogger with implicit member name
Include NetStandard in NetCore
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user