Re: [go-nuts] Can't capture stderr after upgrading to glog v1.1.0

2023-03-17 Thread 'Chressie Himpel' via golang-nuts
On Fri, Mar 17, 2023 at 10:16 AM Stuart McLean wrote: > > Thanks so much for the quick answers. I did try setting the `alsologtostderr` > flag (and adding `flag.Parse()` after) but it doesn’t make a difference. I’m > trying to capture error logs anyway. I’ve tried stepping through the glog > co

Re: [go-nuts] Can't capture stderr after upgrading to glog v1.1.0

2023-03-17 Thread 'Stuart McLean' via golang-nuts
I’m not sure where to add os.Stderr.Sync() so I tried in a few spots, including directly after my call to glog.Error Here’s playground version: https://go.dev/play/p/sHEATjMRhtN It outputs: E1110 23:00:00.00 11 prog.go:26] foo bar captured: When I run the same code with glog v1.0.0 it

Re: [go-nuts] Help to choose the right type of the key for a map.

2023-03-17 Thread alex-coder
Andy, thank you. In case there would be a choice between ugly and achievable, I must take the last one:-) Another thing I have found it that it is impossible to use type as a parameter when you call to a function. How to pass type to function argument in Go - Stack Overflow

Re: [go-nuts] Can't capture stderr after upgrading to glog v1.1.0

2023-03-17 Thread 'Stuart McLean' via golang-nuts
Thanks so much for the quick answers. I did try setting the `alsologtostderr` flag (and adding `flag.Parse()` after) but it doesn’t make a difference. I’m trying to capture error logs anyway. I’ve tried stepping through the glog code and it looks like messages are being written to a buffer for s