1 Star 0 Fork 0

cube-lab/tcb-openapi

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
logger.go 412 Bytes
Copy Edit Raw Blame History
evansleiliu authored 2021-04-05 10:36 . init
package util
import (
"fmt"
"github.com/sirupsen/logrus"
"strings"
"time"
)
type CustomerFormatter struct {
Prefix string
}
func (s *CustomerFormatter) Format(entry *logrus.Entry) ([]byte, error) {
timestamp := time.Now().Local().Format("2006/01/02 15:04:05")
msg := fmt.Sprintf("[%s] %s [%s] %s\n", s.Prefix, timestamp, strings.ToUpper(entry.Level.String()), entry.Message)
return []byte(msg), nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cubelab/tcb-openapi.git
git@gitee.com:cubelab/tcb-openapi.git
cubelab
tcb-openapi
tcb-openapi
41edef41dc45

Search