19 lines
339 B
Go
19 lines
339 B
Go
package logging
|
|
|
|
import (
|
|
"git.sr.ht/~cco/go-scopes/lib"
|
|
"github.com/rs/zerolog"
|
|
)
|
|
|
|
type Evt = zerolog.Event
|
|
|
|
func Debug(ctx lib.Context) *Evt {
|
|
return WithContext(ctx, GetLogger(ctx).Debug())
|
|
}
|
|
|
|
func WithContext(ctx lib.Context, e *Evt) *Evt {
|
|
if e == nil || ctx == nil {
|
|
return e
|
|
}
|
|
return e.Str("service", ctx.Config().Name())
|
|
}
|