embed (hidden) tailsql for debugging (#1663)
Signed-off-by: Kristoffer Dalby <kristoffer@dalby.cc>
This commit is contained in:
parent
6049ec758c
commit
55ca078f22
7 changed files with 324 additions and 32 deletions
|
@ -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...)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue