Changeset 467 for TFP-WebServer/WebServer/src/LogBuffer.cs
- Timestamp:
- Aug 18, 2023, 12:08:10 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TFP-WebServer/WebServer/src/LogBuffer.cs
r434 r467 12 12 13 13 private int listOffset; 14 15 public static event Action<LogEntry> EntryAdded; 14 16 15 17 public static void Init () { … … 60 62 61 63 private void LogCallback (string _formattedMsg, string _plainMsg, string _trace, LogType _type, DateTime _timestamp, long _uptime) { 62 LogEntry le = new LogEntry (_timestamp, _plainMsg, _trace, _type, _uptime); 64 lock (logEntries) { 65 LogEntry le = new LogEntry (listOffset + logEntries.Count, _timestamp, _plainMsg, _trace, _type, _uptime); 63 66 64 lock (logEntries) {65 67 logEntries.Add (le); 68 EntryAdded?.Invoke (le); 69 66 70 if (logEntries.Count <= maxEntries) { 67 71 return; … … 126 130 127 131 public class LogEntry { 132 public readonly int MessageId; 128 133 public readonly DateTime Timestamp; 129 134 public readonly string IsoTime; … … 133 138 public readonly long Uptime; 134 139 135 public LogEntry (DateTime _timestamp, string _message, string _trace, LogType _type, long _uptime) { 140 public LogEntry (int _messageId, DateTime _timestamp, string _message, string _trace, LogType _type, long _uptime) { 141 MessageId = _messageId; 142 136 143 Timestamp = _timestamp; 137 144 IsoTime = _timestamp.ToString ("o");
Note:
See TracChangeset
for help on using the changeset viewer.