logs-fix-7
This commit is contained in:
parent
cdad58bd02
commit
be58bb8c6d
|
@ -3,6 +3,7 @@ package logs
|
|||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
@ -17,7 +18,7 @@ func (u LogTextFormatter) Format(e *logrus.Entry) ([]byte, error) {
|
|||
timestamp := e.Time.Format("2006-01-02 15:04:05.000")
|
||||
level := strings.ToUpper(e.Level.String())
|
||||
message := e.Message
|
||||
file := path.Base(e.Caller.File)
|
||||
file := filepath.Base(e.Caller.File)
|
||||
line := e.Caller.Line
|
||||
|
||||
return []byte(fmt.Sprintf("%s [%s] %s:%d %s\n", timestamp, level, file, line, message)), nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user