Changeset 467 for TFP-WebServer/WebServer/src/WebAPI/APIs/LogApi.cs
- Timestamp:
- Aug 18, 2023, 12:08:10 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TFP-WebServer/WebServer/src/WebAPI/APIs/LogApi.cs
r459 r467 12 12 private static readonly byte[] jsonKeyLastLine = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("lastLine"); 13 13 14 private static readonly byte[] jsonMsgKey = JsonWriter.GetEncodedPropertyNameWithBeginObject ("msg"); 14 private static readonly byte[] jsonIdKey = JsonWriter.GetEncodedPropertyNameWithBeginObject ("id"); 15 private static readonly byte[] jsonMsgKey = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("msg"); 15 16 private static readonly byte[] jsonTypeKey = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("type"); 16 17 private static readonly byte[] jsonTraceKey = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("trace"); … … 57 58 } 58 59 59 writer.WriteRaw (jsonMsgKey); 60 writer.WriteString (logEntry.Message); 61 62 writer.WriteRaw (jsonTypeKey); 63 writer.WriteString (logEntry.Type.ToStringCached ()); 64 65 writer.WriteRaw (jsonTraceKey); 66 writer.WriteString (logEntry.Trace); 67 68 writer.WriteRaw (jsonIsotimeKey); 69 writer.WriteString (logEntry.IsoTime); 70 71 writer.WriteRaw (jsonUptimeKey); 72 writer.WriteString (logEntry.Uptime.ToString ()); 73 74 writer.WriteEndObject (); 60 WriteLogMessageObject (ref writer, logEntry); 75 61 } 76 62 … … 87 73 SendEnvelopedResult (_context, ref writer); 88 74 } 75 76 public static void WriteLogMessageObject (ref JsonWriter _writer, LogBuffer.LogEntry _logEntry) { 77 _writer.WriteRaw (jsonIdKey); 78 _writer.WriteInt32 (_logEntry.MessageId); 79 80 _writer.WriteRaw (jsonMsgKey); 81 _writer.WriteString (_logEntry.Message); 82 83 _writer.WriteRaw (jsonTypeKey); 84 _writer.WriteString (_logEntry.Type.ToStringCached ()); 85 86 _writer.WriteRaw (jsonTraceKey); 87 _writer.WriteString (_logEntry.Trace); 88 89 _writer.WriteRaw (jsonIsotimeKey); 90 _writer.WriteString (_logEntry.IsoTime); 91 92 _writer.WriteRaw (jsonUptimeKey); 93 _writer.WriteString (_logEntry.Uptime.ToString ()); 94 95 _writer.WriteEndObject (); 96 } 89 97 } 90 98 }
Note:
See TracChangeset
for help on using the changeset viewer.