Logging WIP
This commit is contained in:
parent
a6641980c2
commit
5d6051c490
11 changed files with 108 additions and 124 deletions
|
@ -76,7 +76,7 @@ func (e *Event) Fields(fields map[string]any) *Event {
|
|||
return e
|
||||
}
|
||||
|
||||
func (e *Event) Context(contexts ...Ctx) *Event {
|
||||
func (e *Event) Context(contexts ...Contexter) *Event {
|
||||
for _, c := range contexts {
|
||||
e.Fields(c.Context())
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ func Trace(message string, v ...any) {
|
|||
newEvent().Trace(message, v...)
|
||||
}
|
||||
|
||||
func Context(contexts ...Ctx) *Event {
|
||||
func Context(contexts ...Contexter) *Event {
|
||||
return newEvent().Context(contexts...)
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ func ToFormat(s string) Format {
|
|||
}
|
||||
}
|
||||
|
||||
type Ctx interface {
|
||||
type Contexter interface {
|
||||
Context() map[string]any
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ func (f fieldsCtx) Context() map[string]any {
|
|||
return f
|
||||
}
|
||||
|
||||
func NewCtx(fields map[string]any) Ctx {
|
||||
func NewCtx(fields map[string]any) Contexter {
|
||||
return fieldsCtx(fields)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue