mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-18 14:47:03 +00:00
trace: Include debug messages in the traces
We don't want to write debug messages to the log, but having them in traces is always useful. The traces are volatile and self-cleaning so the additional volume should not cause any problems, and helps troubleshooting. While at it, fix the depth constant when logging.
This commit is contained in:
@@ -25,16 +25,17 @@ func (t *Trace) Printf(format string, a ...interface{}) {
|
||||
if glog.V(0) {
|
||||
msg := fmt.Sprintf("%s %s: %s", t.family, t.title,
|
||||
quote(fmt.Sprintf(format, a...)))
|
||||
glog.InfoDepth(2, msg)
|
||||
glog.InfoDepth(1, msg)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Trace) Debugf(format string, a ...interface{}) {
|
||||
t.t.LazyPrintf(format, a...)
|
||||
|
||||
if glog.V(2) {
|
||||
t.t.LazyPrintf(format, a...)
|
||||
msg := fmt.Sprintf("%s %s: %s", t.family, t.title,
|
||||
quote(fmt.Sprintf(format, a...)))
|
||||
glog.InfoDepth(2, msg)
|
||||
glog.InfoDepth(1, msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user