logfmt

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 15 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL