Better tracing
Not done yet, still need to add them to just about every other function
This commit is contained in:
parent
83f47d17be
commit
529d106351
13 changed files with 148 additions and 22 deletions
20
util/tracing.go
Normal file
20
util/tracing.go
Normal 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")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue