4 ms·
when outputting lots of information (like a running game) i found that a "csv-like" format is actually the best compromise between readability and being structu
by dgan 4y ago
when outputting lots of information (like a running game) i found that a "csv-like" format is actually the best compromise between readability and being structured.
Just log "header_1;header2;... value_1;value_2;..." you can still grep it, or redirect to a file and parse later
- Cthulhu_ 4y agoin Javascript applications, you can use `console.table()`: https://developer.mozilla.org/en-US/docs/Web/API/console/table https://developer.mozilla.org/en-US/docs/Web/API/console/tab...
- dwaltrip 4y agoI can't believe I've never heard of this! Thanks
- floren 4y agoWe've settled on RFC5424 syslog messages with structured data elements (https://datatracker.ietf.org/doc/html/rfc5424#section-6.3 https://datatracker.ietf.org/doc/html/rfc5424#section-6.3). You get a message, plus a bunch of key-value pairs of additional info: <14>1 2022-05-06T21:01:24.54493Z web1.floren.lan webserver 20000066 webserver/search.go:188 [gw@1 searchid="13094420576" uid="2" user="john" query="tag=gravwell" start="2022-05-06T20:01:24Z" end="2022-05-06T21:01:24Z" background="false"] Search launched