fs: expand stats output for json log
This commit is contained in:
@@ -3,6 +3,7 @@ package fs
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -86,6 +87,10 @@ func LogPrintf(level LogLevel, o interface{}, text string, args ...interface{})
|
||||
"objectType": fmt.Sprintf("%T", o),
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(out, "map[") {
|
||||
fields["json"] = args[0]
|
||||
out = ""
|
||||
}
|
||||
switch level {
|
||||
case LogLevelDebug:
|
||||
logrus.WithFields(fields).Debug(out)
|
||||
|
||||
Reference in New Issue
Block a user