author | Alberto Bertogli
<albertito@blitiri.com.ar> 2022-09-25 10:12:31 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2022-10-07 10:59:43 UTC |
parent | b13b9eab9aabab003872fca2597bda157582f084 |
trace/trace.go | +4 | -2 |
diff --git a/trace/trace.go b/trace/trace.go index 34b5418..7a3480e 100644 --- a/trace/trace.go +++ b/trace/trace.go @@ -44,8 +44,10 @@ func (t *Trace) SetMaxEvents(n int) { func (t *Trace) Printf(format string, a ...interface{}) { t.t.Printf(format, a...) - log.Log(log.Debug, 1, "%#p %s %s: %s", - t, t.family, t.title, fmt.Sprintf(format, a...)) + if log.Default.Level <= log.Debug { + log.Log(log.Debug, 1, "%#p %s %s: %s", t, t.family, t.title, + fmt.Sprintf(format, a...)) + } } // Errorf adds this message to the trace's log, with an error level.