Continued logging work
This commit is contained in:
15
log/types.go
15
log/types.go
@@ -91,19 +91,14 @@ func ToFormat(s string) Format {
|
||||
}
|
||||
}
|
||||
|
||||
// Contexter allows structs to export a key-value pairs in the form of a Context
|
||||
type Contexter interface {
|
||||
Context() map[string]any
|
||||
// Context returns the object context as key-value pairs
|
||||
Context() Context
|
||||
}
|
||||
|
||||
type fieldsCtx map[string]any
|
||||
|
||||
func (f fieldsCtx) Context() map[string]any {
|
||||
return f
|
||||
}
|
||||
|
||||
func NewCtx(fields map[string]any) Contexter {
|
||||
return fieldsCtx(fields)
|
||||
}
|
||||
// Context represents an object's state in the form of key-value pairs
|
||||
type Context map[string]any
|
||||
|
||||
type levelOverride struct {
|
||||
value any
|
||||
|
||||
Reference in New Issue
Block a user