JSONL → logfmt
This tool reads JSON lines from stdin and prints something like logfmt to stderr. Keys are highlighted if stderr is attached to a terminal. Non-JSON lines are printed to stdout. Pass -x <glob> to ignore keys.
$ echo '{"at":"hello"}' | logfmt
at=hello
Subprocess Logs
If you want to capture stderr without redirecting or handle signals properly, give logfmt a command to execute. The command's stdout and stderr will be filtered as above.
If logfmt receives SIGINT, SIGTERM, SIGHUP, SIGQUIT, SIGUSR, or SIGUSR2, the signal is forwarded to the command.
$ logfmt echo '{"at":"hello"}'
at=hello