@ -15,7 +15,7 @@ type simpleFormatter struct {
}
// Format implements log.Formatter
func (f simpleFormatter) Format(level Level, msg string, logger *Logger) []byte {
func (f *simpleFormatter) Format(level Level, msg string, logger *Logger) []byte {
time := time.Now().Format("15:04:05.000")
return []byte(fmt.Sprintf("%s %s %s\n", time, level.String(), msg))
@ -23,7 +23,7 @@ type JSONFormatter struct {
func (f JSONFormatter) Format(level log.Level, msg string, logger *log.Logger) []byte {
func (f *JSONFormatter) Format(level log.Level, msg string, logger *log.Logger) []byte {
// output fields: time level host app pid file line msg
f.init.Do(func() {
@ -32,7 +32,7 @@ type TextFormatter struct {
func (f TextFormatter) Format(level log.Level, msg string, logger *log.Logger) []byte {
func (f *TextFormatter) Format(level log.Level, msg string, logger *log.Logger) []byte {
// output format: DATE LEVEL HOST APP PID file:line message
// 2001-10-10T12:00:00,000+0800 INFO web-1 app 1234 main/main.go:1234 message ...