Skip to content

About

Parse and emit logfmt (key=value) log lines — zero dependencies, handles quoting.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

logfmt line parser & formatter

I needed a quick way to parse and emit logfmt key-value lines for a logging side project last weekend. Writing this took me about three hours and cost zero dollars, mostly because I refused to pull in heavy third-party packages just to split strings. It handles the annoying edge cases like nested quoting without adding extra baggage.

The whole thing relies entirely on the Python standard library. You do not have to install any external services, SDKs, or weird dependencies. Just drop the file in your repo and run it.

logfmt.py

I kept the tests right next to the implementation file. Run them locally to see exactly how it handles the weird formatting quirks in practice.

About

Parse and emit logfmt (key=value) log lines — zero dependencies, handles quoting.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages