1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +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:
Alberto Bertogli
2016-10-08 14:39:27 +01:00
parent 3e55b0d742
commit 2b46f300ca

View File

@@ -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)
}
}