When logging in Go with log.Println, I frequently get
2012/05/13 16:45:50 evaluating %v(PANIC=3)
I’m not sure how to determine what I’ve done wrong, I assume that somewhere fmt.Println has caught a panic generated by one of my own Stringer interface implementations, so as not to crash my program due to logging failure.
How do I work out what’s going on? Why am I getting this erroneous message?
You are right, there is a panic in a
Stringmethod. But it has nothing to do with thelogpackage.Printlnuses%v, and%vmeans runningStringmethod. Having a panic in theStringmethod invokescatchPanic. Here in your output3is the value of your panic.