Ai
1 Star 0 Fork 0

cube-lab/tcb-openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
logger.go 412 Bytes
一键复制 编辑 原始数据 按行查看 历史
evansleiliu 提交于 2021-04-05 10:36 +08:00 . 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
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cubelab/tcb-openapi.git
git@gitee.com:cubelab/tcb-openapi.git
cubelab
tcb-openapi
tcb-openapi
41edef41dc45

搜索帮助