Skip to content

Commit af8ee5e

Browse files
committed
style(logging): 修改日志格式,增加时间和消息之间的制表符
1 parent ba87c3a commit af8ee5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/logging/service.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ func (s *serviceLoggerSetting) Format(entry *logrus.Entry) ([]byte, error) {
4242

4343
fmt.Fprintf(
4444
b,
45-
"%-18s %s | %s\n", // 长度需要算是上控制字符的长度
46-
fmt.Sprintf("\033[3%dm【%s】\033[0m", colorCode, strings.ToUpper(entry.Level.String())),
45+
"\033[3%dm【%s】\033[0m\t%s | %s\n", // 长度需要算是上控制字符的长度
46+
colorCode,
47+
strings.ToUpper(entry.Level.String()),
4748
formatTime,
4849
entry.Message,
4950
)

0 commit comments

Comments
 (0)