19 lines
388 B
Go
19 lines
388 B
Go
package logs
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// LogTextFormatter is a custom log formatter for text output
|
|
type LogTextFormatter struct {
|
|
logrus.Formatter
|
|
}
|
|
|
|
// Format helps fomratting time to UTC
|
|
func (u LogTextFormatter) Format(e *logrus.Entry) ([]byte, error) {
|
|
return []byte(fmt.Sprintf("[%s] %s", strings.ToUpper(e.Level.String()), e.Message)), nil
|
|
}
|