Better tracing

Not done yet, still need to add them to just about every other function
This commit is contained in:
Melody Becker 2024-11-06 16:57:44 +01:00
parent 83f47d17be
commit 529d106351
13 changed files with 148 additions and 22 deletions

20
util/tracing.go Normal file
View file

@ -0,0 +1,20 @@
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")
}
}