logs-fix-4

This commit is contained in:
2024-01-22 15:02:22 +03:00
parent c53ada95eb
commit bdcf2c39f7
5 changed files with 36 additions and 73 deletions

18
server/logs/text.go Normal file
View File

@@ -0,0 +1,18 @@
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
}