This format is quite specific - roll your own!
See for example https://github.com/shamaazi/antilog or a derivative 
(github.com/UNO-SOFT/ulog) - very simple code, easy to modify.

My experience is against logfmt: is is nice, human-readable, but it is hard 
to log structures with it - you'll use fmt.Sprintf("%#v", structure), or 
json.Marshal(structure).

ChrisLu a következőt írta (2020. november 18., szerda, 5:21:48 UTC+1):

> I am considering moving from glog to structured logging. I tried logrus, 
> go-kit, uber/zap, but could not find one good fit. In short, this is the 
> desired format:
>
> [info][timestamp] [filename:line_number] message k1=v1 k2=v2 ...
>
> It shows the correct file name(need to pop out a few call stacks) and line 
> number in a customizable format, not as key-value pair for each line which 
> is just too verbose to have the extra "time=" "file=".
>
> Please let me know the one you actually use.
>
>
> Thanks!
> Chris
> ---------
> https://github.com/chrislusf/seaweedfs
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/9332eaf7-77af-455b-823d-dd8af97ba1e8n%40googlegroups.com.

Reply via email to