mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-04 04:08:02 +02:00
Continued logging work
This commit is contained in:
parent
27bd79febf
commit
7cc8c81bd8
28 changed files with 287 additions and 171 deletions
log
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue