logs-fix-14
This commit is contained in:
parent
7c949417c1
commit
3502d8b3d1
|
@ -1,23 +1,9 @@
|
||||||
package logs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
type LogTextFormatter struct {
|
|
||||||
logrus.Formatter
|
|
||||||
}
|
|
||||||
|
|
||||||
func (u LogTextFormatter) Format(e *logrus.Entry) ([]byte, error) {
|
func (u LogTextFormatter) Format(e *logrus.Entry) ([]byte, error) {
|
||||||
level := strings.ToUpper(e.Level.String())
|
level := strings.ToUpper(e.Level.String())
|
||||||
message := e.Message
|
message := e.Message
|
||||||
parts := strings.SplitN(message, " +0000]", 2)
|
parts := strings.SplitN(message, " +0000]", 2)
|
||||||
if len(parts) >= 2 {
|
if len(parts) >= 2 {
|
||||||
message = parts[2]
|
message = parts[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
var color string
|
var color string
|
||||||
|
|
Loading…
Reference in New Issue
Block a user