refactor: small improvements and clean up (#3423)
* refactor: replace custom map functions with slice.Map * refactor: extract StringerValue function * refactor: removed unnecessary if * chore: removed invalid comment * refactor: replace more map functions * chore: fix FFmpeg typo
This commit is contained in:
+1
-7
@@ -7,7 +7,6 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
@@ -277,12 +276,7 @@ func addFields(logger *logrus.Entry, keyValuePairs []interface{}) *logrus.Entry
|
||||
case time.Duration:
|
||||
logger = logger.WithField(name, ShortDur(v))
|
||||
case fmt.Stringer:
|
||||
vOf := reflect.ValueOf(v)
|
||||
if vOf.Kind() == reflect.Pointer && vOf.IsNil() {
|
||||
logger = logger.WithField(name, "nil")
|
||||
} else {
|
||||
logger = logger.WithField(name, v.String())
|
||||
}
|
||||
logger = logger.WithField(name, StringerValue(v))
|
||||
default:
|
||||
logger = logger.WithField(name, v)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user