Open
Description
from logfmt import format
def test_logfmt_format():
data = {
"at": "info",
"method": "GET",
"path": "/",
"host": "mutelight.org",
"fwd": "124.133.52.161",
"dyno": "web.2",
"connect": "4ms",
"service": "8ms",
"status": 200,
"bytes": 1653,
}
expected = 'at=info method=GET path=/ host=mutelight.org fwd="124.133.52.161" dyno=web.2 connect=4ms service=8ms status=200 bytes=1653'
assert expected == ''.join(format(data))
# actual = 'at="info" method="GET" path="/" host=mutelight.org fwd="124.133.52.161" dyno="web.2" connect="4ms" service="8ms" status=200 bytes=1653'
logfmt-python unnecessarily quotes values, which doesn't match the behavior of similar libraries.
Metadata
Metadata
Assignees
Labels
No labels