mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 08:07:42 +00:00
types/logger: fix LogOnChange to pass through format/args to underlying logger
So they don't get interpretted as a format pattern or get rate-limited away in the wrong way.
This commit is contained in:
parent
ff7ddd9d20
commit
8b904b1493
@ -158,7 +158,10 @@ func LogOnChange(logf Logf, maxInterval time.Duration, timeNow func() time.Time)
|
|||||||
tLastLogged = timeNow()
|
tLastLogged = timeNow()
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
|
|
||||||
logf(s)
|
// Re-stringify it (instead of using "%s", s) so something like "%s"
|
||||||
|
// doesn't end up getting rate-limited. (And can't use 's' as the pattern,
|
||||||
|
// as it might contain formatting directives.)
|
||||||
|
logf(format, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user