Doc: add more description for Template keyword
tonyho opened this issue · 1 comments
tonyho commented
Any place have the info about the meaning of all kinds of Template keywords?
For example:
const simplestTemplate = "[{{datetime}}] [{{level}}] {{message}} {{data}} {{extra}}"
What's the meaning of data
and extra
in above template string?
Thanks.
inhere commented
data, extra
- Used to logging some complex data
examples:
slog.Warn("warning log message")
slog.WithData(slog.M{
"key0": 134,
"key1": "abc",
}).Infof("info log %s", "message")
output:
[WARNING] warning log message
[INFO] info log message {key0:134, key1:abc}