Re: [go-nuts] Re: exec: "date": executable file not found in %PATH%

2020-11-18 Thread Kurtis Rader
On Wed, Nov 18, 2020 at 2:09 PM Sourav Singh wrote: > How do I do this for linux ? > Do what, exactly? The exec.Command function works fine on Linux and because Linux has external commands such as "echo" you're unlikely to have the sort of problems the O.P. was having on Windows. Also, in the fu

[go-nuts] Re: exec: "date": executable file not found in %PATH%

2020-11-18 Thread Sourav Singh
How do I do this for linux ? On Thursday, September 17, 2015 at 8:08:52 AM UTC+5:30 Th3x0d3r wrote: > Thanks, It does the trick. ! > -- 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

[go-nuts] Re: Any recommendation for structured logging library in Golang?

2020-11-18 Thread seank...@gmail.com
Since you've been using glog, k8s.io/klog/v2 (fork by kubernetes) should feel familiar and v2 supports the structured variants On Wednesday, November 18, 2020 at 5:21:48 AM UTC+1 ChrisLu wrote: > I am considering moving from glog to structured logging. I tried logrus, > go-kit, uber/zap, but co

[go-nuts] Re: Any recommendation for structured logging library in Golang?

2020-11-18 Thread Tamás Gulácsi
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

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-18 Thread Afriyie Abraham Kwabena
Hi Sulhan, Anderson, Thanks for your guidance. It works now using time.Ticker func worker() { tiker := time.NewTicker(30 * time.Second) for _ = range tiker.C { mu.Lock() for keyid := range idtime { d := time.Now().Unix() - idtime[keyid] if d >= 60

Re: [go-nuts] Any recommendation for structured logging library in Golang?

2020-11-18 Thread Chris Lu
On Tue, Nov 17, 2020 at 11:20 PM Gopal M wrote: > go.uber.org/zap > > I have tried uber/zap, which has a verbose json: {time="...", file="abc.go", line="32", message="xafasdfasdf", k1=v1, k2=v2} The extra "time=" and "file=" on every single log line are what I want to avoid. Do you have some wa