log package:df1
If sucessful, parsing will stop after the first CR or LF newline
marker if any, otherwise it will consume all input.
Renders a
Log on its own line. Doesn't include a trailing
newline character.
For example:
2019-11-15T18:05:54.949470902Z NOTICE Welcome to my program!
2019-11-15T18:05:54.949623731Z /initialization NOTICE Starting web server
2019-11-15T18:05:54.949630205Z /initialization ALERT Disk is almost full!!!
2019-11-15T18:05:54.949640299Z /server port=80 INFO Listening for new clients
2019-11-15T18:05:54.949652133Z /server port=80 /handler client-address=10.0.0.8 INFO Connection established
2019-11-15T18:05:54.949664482Z /server port=80 /handler client-address=10.0.0.8 WARNING user error (Oops!)
Importance level of the logged message.
Human-readable message itself.
Path where the logged message was created from.
The leftmost
Path is the closest to the root. The rightmost
Path is the one closest to where the log was generated.
An
empty Seq is acceptable, conveying the idea of the
“root path”.
First known timestamp when the log was generated.
We use
SystemTime rather than
UTCTime because it is
cheaper to obtain and to render. You can use
systemToUTCTime to
convert it if necessary.
Like
log, but with ANSI colors.