linstrom/util/tracing.go
mStar 529d106351 Better tracing
Not done yet, still need to add them to just about every other function
2024-11-06 16:57:44 +01:00

20 lines
305 B
Go

package util
import (
"github.com/rs/zerolog"
)
func Trace(l *zerolog.Logger) *zerolog.Logger {
if e := l.Trace(); e.Enabled() {
e.Caller(2).
Msg("Entered function")
}
return l
}
func Untrace(l *zerolog.Logger) {
if e := l.Trace(); e.Enabled() {
e.Caller(2).
Msg("Exited function")
}
}