From 63dd4ae25c8c7f4aeffcd65ed1ebd5f7acc3faea Mon Sep 17 00:00:00 2001 From: Timerix22 Date: Thu, 17 Nov 2022 21:45:52 +0600 Subject: [PATCH] format fix --- DTLib.Logging/DependencyInjection/MyLoggerWrapper.cs | 2 +- DTLib.Logging/LogFormats/DefaultLogFormat.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DTLib.Logging/DependencyInjection/MyLoggerWrapper.cs b/DTLib.Logging/DependencyInjection/MyLoggerWrapper.cs index d095122..b685344 100644 --- a/DTLib.Logging/DependencyInjection/MyLoggerWrapper.cs +++ b/DTLib.Logging/DependencyInjection/MyLoggerWrapper.cs @@ -12,7 +12,7 @@ public class MyLoggerWrapper : Microsoft.Extensions.Logging.ILogger(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) { string message = formatter(state, exception); - _logger.Log(nameof(TCaller), LogSeverity_FromLogLevel(logLevel), message); + _logger.Log(typeof(TCaller).Name, LogSeverity_FromLogLevel(logLevel), message); } private bool _isEnabled=true; diff --git a/DTLib.Logging/LogFormats/DefaultLogFormat.cs b/DTLib.Logging/LogFormats/DefaultLogFormat.cs index 21cf0d9..a51344f 100644 --- a/DTLib.Logging/LogFormats/DefaultLogFormat.cs +++ b/DTLib.Logging/LogFormats/DefaultLogFormat.cs @@ -20,7 +20,7 @@ public class DefaultLogFormat : ILogFormat if (PrintTimeStamp) sb.Append('[').Append(DateTime.Now.ToString(MyTimeFormat.ForText)).Append(']'); if (PrintContext && PrintSeverity) - sb.Append('[').Append(context).Append('/').Append(severity.ToString().Append(']')); + sb.Append('[').Append(context).Append('/').Append(severity.ToString()).Append(']'); else if(PrintContext) sb.Append('[').Append(context).Append(']'); else if(PrintSeverity)