You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missing context keys would be passed empty strings, unused context items would be added to the end
BTW noticed the following in format
// try to justify the log output for short messages
if len(r.Ctx) > 0 && len(r.Msg) < termMsgJust {
b.Write(bytes.Repeat([]byte{' '}, termMsgJust-len(r.Msg)))
}
That could be removed by changing the above format statements to
Interesting idea. Have you seen the discussion on issue #14?
I'm on the fence here. On the one hand TerminalFormat is documented as not recommended for production uses because it isn't as machine parsable as other formats, so giving the developer some control seems reasonable. On the other hand it goes against log15's opinion that we should prefer machine parsable log formats.
If we did include a format like this in log15 we would prefer to create a new format rather than breaking the v2 API by changing the existing TerminalFormat.
I looked at #14 and I agree that machine parsable code is far better to store historical data, that said watching an os.StdOut dump visually is far easier if we can specify the order. For example in my web application the logger will always have the ip, module and controller in the log context so I would like to be able to specify for the terminal output those items first, then the message then any other context.
And I am ok with a new Formatter implementing this.
It would be nice if I could specify a series of keys into TerminalFormat so that I could layout the key values in a specific named order like
Missing context keys would be passed empty strings, unused context items would be added to the end
BTW noticed the following in format
That could be removed by changing the above format statements to
The "%-40s" provides the right pad
This is a great package, the value of the
MatchFilterHandler
is underated and makes this the perfect tool for module logs. thanks !The text was updated successfully, but these errors were encountered: