mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 16:11:23 +00:00
types/logger: add WithPrefix, use it in two places
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -7,4 +7,12 @@
|
||||
// types around.
|
||||
package logger
|
||||
|
||||
type Logf func(fmt string, args ...interface{})
|
||||
// Logf is the basic Tailscale logger type: a printf-like func.
|
||||
type Logf func(format string, args ...interface{})
|
||||
|
||||
// WithPrefix wraps f, prefixing each format with the provided prefix.
|
||||
func WithPrefix(f Logf, prefix string) Logf {
|
||||
return func(format string, args ...interface{}) {
|
||||
f(prefix+format, args...)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user