embed (hidden) tailsql for debugging (#1663)

Signed-off-by: Kristoffer Dalby <kristoffer@dalby.cc>
This commit is contained in:
Kristoffer Dalby
2023-12-20 21:47:48 +01:00
committed by GitHub
parent 6049ec758c
commit 55ca078f22
7 changed files with 324 additions and 32 deletions

View File

@@ -1,7 +1,16 @@
package util
import "github.com/rs/zerolog/log"
import (
"github.com/rs/zerolog/log"
"tailscale.com/types/logger"
)
func LogErr(err error, msg string) {
log.Error().Caller().Err(err).Msg(msg)
}
func TSLogfWrapper() logger.Logf {
return func(format string, args ...any) {
log.Debug().Caller().Msgf(format, args...)
}
}