logs-fix-14
This commit is contained in:
parent
7c949417c1
commit
3502d8b3d1
|
@ -1,24 +1,10 @@
|
|||
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) {
|
||||
level := strings.ToUpper(e.Level.String())
|
||||
message := e.Message
|
||||
parts := strings.SplitN(message, " +0000]", 2)
|
||||
if len(parts) >= 2 {
|
||||
message = parts[2]
|
||||
}
|
||||
if len(parts) >= 2 {
|
||||
message = parts[1]
|
||||
}
|
||||
|
||||
var color string
|
||||
switch e.Level {
|
||||
|
|
Loading…
Reference in New Issue
Block a user