Skip to content

Commit cd77569

Browse files
committed
some docs
1 parent c007029 commit cd77569

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

internal/entryhuman/logfmt/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# logfmt
2+
3+
logfmt provides an implementation that supports nested objects and arrays. It
4+
is meant to be a drop-in replacement for JSON, which other logfmt implements
5+
do not support.
6+
7+
This package makes the trade-off of being more difficult for computers to parse
8+
in favor of the human.
9+
10+
See these examples:
11+
12+
JSON:
13+
```json
14+
{ "user": { "id": 123, "name": "foo", "age": 20, "hobbies": ["basketball", "football"] } }
15+
```
16+
17+
flat logfmt:
18+
```
19+
user.id=123 user.name=foo user.age=20 user.hobbies="basketball,football"
20+
```
21+
22+
nested logfmt:
23+
```
24+
user={ id=123 name=foo age=20 hobbies=[basketball football] }
25+
```

0 commit comments

Comments
 (0)