tracy: key=value format
Closed this issue · 4 comments
Simpler format for this one. Needs a couple things:
- Require all props to have
string
orfmt.Stringer
values - Enclose all values in single or double quotes (configurable)
- Automatically populate timestamp
Simpler format for this one. Needs a couple things:
- Require all props to have
string
orfmt.Stringer
values- Enclose all values in single or double quotes (configurable)
- Automatically populate timestamp
Hey i would like to work on this issue could you provide more details ?
Hey, @mdrokz! Sure thing. That first bullet point is probably a bad idea. Including int, float, and bool is also desired. A log should look like this:
level=7 timestamp=2001-01-01T00:00:00Z message="hello, world!" stringProp="value" intProp=1 floatProp=2.0 boolProp=true
So, the rules are:
level
is the passed log level as an integertimestamp
istime.Now()
in some format (rfc3339 is usually a good bet) NOT enclosed in quotesmessage
is the log message, enclosed in quotes- each prop is appended as
prop.Name=prop.Value
, but props whose value isstring
should be enclosed in quotes.
This is about 90% a formatting challenge. Feel free to ping me here or on Discord if I can help out.
Oh, and make sure you git pull --rebase origin main
before you start, I just merged some changes in.
Hey, @mdrokz! Sure thing. That first bullet point is probably a bad idea. Including int, float, and bool is also desired. A log should look like this:
level=7 timestamp=2001-01-01T00:00:00Z message="hello, world!" stringProp="value" intProp=1 floatProp=2.0 boolProp=true
So, the rules are:
level
is the passed log level as an integertimestamp
istime.Now()
in some format (rfc3339 is usually a good bet) NOT enclosed in quotesmessage
is the log message, enclosed in quotes- each prop is appended as
prop.Name=prop.Value
, but props whose value isstring
should be enclosed in quotes.This is about 90% a formatting challenge. Feel free to ping me here or on Discord if I can help out.
Cool gotcha i will let you know if i face any issues