mirror of
https://github.com/zrepl/zrepl.git
synced 2025-06-25 04:01:49 +02:00
logging format 'human': continue printing prefixed fields if some are missing
This commit is contained in:
parent
a0f72b585b
commit
ee5445777d
@ -91,4 +91,3 @@ func (j *PrometheusJob) JobStart(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,14 +77,13 @@ func (f *HumanFormatter) Format(e *logger.Entry) (out []byte, err error) {
|
|||||||
prefixed := make(map[string]bool, len(prefixFields)+2)
|
prefixed := make(map[string]bool, len(prefixFields)+2)
|
||||||
for _, field := range prefixFields {
|
for _, field := range prefixFields {
|
||||||
val, ok := e.Fields[field].(string)
|
val, ok := e.Fields[field].(string)
|
||||||
if ok {
|
if !ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !f.ignored(field) {
|
if !f.ignored(field) {
|
||||||
fmt.Fprintf(&line, "[%s]", val)
|
fmt.Fprintf(&line, "[%s]", val)
|
||||||
prefixed[field] = true
|
prefixed[field] = true
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if line.Len() > 0 {
|
if line.Len() > 0 {
|
||||||
|
@ -105,7 +105,6 @@ type Receiver interface {
|
|||||||
fsrep.Receiver
|
fsrep.Receiver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type FilteredError struct{ fs string }
|
type FilteredError struct{ fs string }
|
||||||
|
|
||||||
func NewFilteredError(fs string) *FilteredError {
|
func NewFilteredError(fs string) *FilteredError {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user