@@ -25,6 +25,8 @@ public ILogger CreateLogger(string categoryName)
2525
2626 public class CustomConsoleLogger : ILogger
2727 {
28+ private const string UtcTimestampFormat = "yyyy-MM-dd'T'HH:mm:ss.fff'Z'" ;
29+
2830 private readonly LogLevel _minimumLogLevel ;
2931
3032 // Minimum LogLevel for CLI output.
@@ -124,7 +126,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
124126 // Apply colors so the abbreviation matches the visual style of engine logs.
125127 // try/finally guarantees the original colors are restored even if Write throws,
126128 // otherwise the console would be left tinted (e.g. red on error) for subsequent output.
127- string mcpTimestamp = DateTime . UtcNow . ToString ( "yyyy-MM-dd'T'HH:mm:ss.fff'Z'" ) ;
129+ string mcpTimestamp = DateTime . UtcNow . ToString ( UtcTimestampFormat ) ;
128130 ConsoleColor mcpOriginalForeGroundColor = Console . ForegroundColor ;
129131 ConsoleColor mcpOriginalBackGroundColor = Console . BackgroundColor ;
130132 try
@@ -154,7 +156,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
154156 }
155157
156158 TextWriter writer = logLevel >= LogLevel . Error ? Console . Error : Console . Out ;
157- string timestamp = DateTime . UtcNow . ToString ( "yyyy-MM-dd'T'HH:mm:ss.fff'Z'" ) ;
159+ string timestamp = DateTime . UtcNow . ToString ( UtcTimestampFormat ) ;
158160 // try/finally guarantees the original colors are restored even if Write throws,
159161 // otherwise the console would be left tinted (e.g. red on error) for subsequent output.
160162 ConsoleColor originalForeGroundColor = Console . ForegroundColor ;
0 commit comments