1313
1414namespace DevProxy . Logging ;
1515
16- sealed class MachineConsoleFormatter : ConsoleFormatter
16+ sealed class JsonConsoleFormatter : ConsoleFormatter
1717{
18- public const string FormatterName = "devproxy-machine " ;
18+ public const string FormatterName = "devproxy-json " ;
1919
2020 private static readonly JsonSerializerOptions _jsonOptions = new ( )
2121 {
@@ -55,7 +55,7 @@ sealed class MachineConsoleFormatter : ConsoleFormatter
5555 private readonly ProxyConsoleFormatterOptions _options ;
5656 private readonly HashSet < MessageType > _filteredMessageTypes ;
5757
58- public MachineConsoleFormatter ( IOptions < ProxyConsoleFormatterOptions > options ) : base ( FormatterName )
58+ public JsonConsoleFormatter ( IOptions < ProxyConsoleFormatterOptions > options ) : base ( FormatterName )
5959 {
6060 Console . OutputEncoding = Encoding . UTF8 ;
6161 _options = options . Value ;
@@ -101,7 +101,7 @@ private void WriteRequestLog(RequestLog requestLog, string category, IExternalSc
101101 pluginName = pluginName [ ( pluginName . LastIndexOf ( '.' ) + 1 ) ..] ;
102102 }
103103
104- var logObject = new MachineRequestLogEntry
104+ var logObject = new JsonRequestLogEntry
105105 {
106106 Type = GetMessageTypeString ( messageType ) ,
107107 Message = requestLog . Message ,
@@ -142,7 +142,7 @@ private static void WriteRegularLogMessage<TState>(in LogEntry<TState> logEntry,
142142 category = category [ ( category . LastIndexOf ( '.' ) + 1 ) ..] ;
143143 }
144144
145- var logObject = new MachineLogEntry
145+ var logObject = new JsonLogEntry
146146 {
147147 Type = "log" ,
148148 Level = GetLogLevelString ( logEntry . LogLevel ) ,
@@ -168,7 +168,7 @@ private static void WriteStructuredOutput(string message, string category, TextW
168168 try
169169 {
170170 var data = JsonSerializer . Deserialize < JsonElement > ( message ) ;
171- var logObject = new MachineResultEntry
171+ var logObject = new JsonResultEntry
172172 {
173173 Type = "result" ,
174174 Data = data ,
@@ -183,7 +183,7 @@ private static void WriteStructuredOutput(string message, string category, TextW
183183 {
184184 // Fallback: if the message isn't valid JSON, write it as a
185185 // regular log entry
186- var logObject = new MachineLogEntry
186+ var logObject = new JsonLogEntry
187187 {
188188 Type = "result" ,
189189 Message = message ,
@@ -216,8 +216,8 @@ private static string GetLogLevelString(LogLevel logLevel) =>
216216 return requestId ;
217217 }
218218
219- // JSON serialization models for machine output
220- private sealed class MachineRequestLogEntry
219+ // JSON serialization models for JSON output
220+ private sealed class JsonRequestLogEntry
221221 {
222222 public string ? Type { get ; set ; }
223223 public string ? Message { get ; set ; }
@@ -228,7 +228,7 @@ private sealed class MachineRequestLogEntry
228228 public string ? Timestamp { get ; set ; }
229229 }
230230
231- private sealed class MachineLogEntry
231+ private sealed class JsonLogEntry
232232 {
233233 public string ? Type { get ; set ; }
234234 public string ? Level { get ; set ; }
@@ -239,7 +239,7 @@ private sealed class MachineLogEntry
239239 public string ? Exception { get ; set ; }
240240 }
241241
242- private sealed class MachineResultEntry
242+ private sealed class JsonResultEntry
243243 {
244244 public string ? Type { get ; set ; }
245245 public JsonElement ? Data { get ; set ; }
0 commit comments