Last change
on this file since 474 was 467, checked in by alloc, 16 months ago |
21.1.16.2 WebServer release
Added "id"s to messages in log API / event
Added "baseUrl" to mods API for WebMods
|
File size:
536 bytes
|
Line | |
---|
1 | using JetBrains.Annotations;
|
---|
2 | using Utf8Json;
|
---|
3 | using Webserver.UrlHandlers;
|
---|
4 | using Webserver.WebAPI.APIs;
|
---|
5 |
|
---|
6 | namespace Webserver.SSE {
|
---|
7 | [UsedImplicitly]
|
---|
8 | public class EventLog : AbsEvent {
|
---|
9 | public EventLog (SseHandler _parent) : base (_parent, _name: "log") {
|
---|
10 | LogBuffer.EntryAdded += LogCallback;
|
---|
11 | }
|
---|
12 |
|
---|
13 | private void LogCallback (LogBuffer.LogEntry _logEntry) {
|
---|
14 | JsonWriter writer = new JsonWriter ();
|
---|
15 | LogApi.WriteLogMessageObject (ref writer, _logEntry);
|
---|
16 |
|
---|
17 | SendData ("logLine", writer.ToString ());
|
---|
18 | }
|
---|
19 | }
|
---|
20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.