MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / Format

Method Format

core/init/log/log.go:55–67  ·  view source on GitHub ↗
(entry *logrus.Entry)

Source from the content-addressed store, hash-verified

53type MineFormatter struct{}
54
55func (s *MineFormatter) Format(entry *logrus.Entry) ([]byte, error) {
56 detailInfo := ""
57 if entry.Caller != nil {
58 function := strings.ReplaceAll(entry.Caller.Function, "github.com/1Panel-dev/1Panel/core/", "")
59 detailInfo = fmt.Sprintf("(%s: %d)", function, entry.Caller.Line)
60 }
61 if len(entry.Data) == 0 {
62 msg := fmt.Sprintf("[%s] [%s] %s %s \n", time.Now().Format(TimeFormat), strings.ToUpper(entry.Level.String()), entry.Message, detailInfo)
63 return []byte(msg), nil
64 }
65 msg := fmt.Sprintf("[%s] [%s] %s %s {%v} \n", time.Now().Format(TimeFormat), strings.ToUpper(entry.Level.String()), entry.Message, detailInfo, entry.Data)
66 return []byte(msg), nil
67}

Callers 7

RunMethod · 0.45
init.goFile · 0.45
GenLogFileNameMethod · 0.45
update.goFile · 0.45
listEnterpriseUsersFunction · 0.45
createdAtStringFunction · 0.45

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected