You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/JSONLogger.swift
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,13 @@ import Logging
33
33
(Note I’m not sure why `json-seq` does not do that but there must be a good reason.
34
34
Probably because the resulting output would not be valid UTF-8 anymore.)
35
35
36
-
The output file descriptor is also customizable and is `stdout` by default. */
36
+
The output file descriptor is also customizable and is `stdout` by default.
37
+
38
+
Finally, the JSON coders are customizable too.
39
+
There is a `JSONEncoder` that create the JSON from a ``LogLine`` entry, which is the struct created internally for any logged line.
40
+
There is also an optional `(JSONEncoder, JSONDecoder)` tuple which is used specifically to get structured metadata from any object in the metadata.
41
+
42
+
All of the JSON output from this logger should be parsable as a ``LogLine`` by a `JSONDecoder` matching the config of the `JSONEncoder` set in the config of the logger. */
0 commit comments