add generic logerr func to shorten code

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-06-22 16:38:57 +02:00 committed by Kristoffer Dalby
parent fe75b71620
commit 665a3cc666
2 changed files with 44 additions and 114 deletions

7
hscontrol/util/log.go Normal file
View file

@ -0,0 +1,7 @@
package util
import "github.com/rs/zerolog/log"
func LogErr(err error, msg string) {
log.Error().Caller().Err(err).Msg(msg)
}