12 lines
654 B
C#
12 lines
654 B
C#
namespace Kit.Helpers
|
|
{
|
|
using Microsoft.Extensions.Logging;
|
|
public static class MicrosoftExtensionsLoggingExt
|
|
{
|
|
public static void LogParamTrace(this ILogger logger, string method, KeyValuePair<string, object?> param) => LogParamsTrace(logger, method, [param]);
|
|
public static void LogParamsTrace(this ILogger logger, string method, IEnumerable<KeyValuePair<string, object?>> @params)
|
|
{
|
|
logger.LogTrace(method + Environment.NewLine + @params.Select(x => $"param \"{x.Key}\": {(x.Value?.JsonSerialize(enableCyrillic: true, writeIntended: true) ?? "<NULL>")}").Join(Environment.NewLine));
|
|
}
|
|
}
|
|
} |