Skip to content

Commit c8cab82

Browse files
committed
fix: 修复debug日志等级颜色渲染错误的问题
1 parent 03f5b49 commit c8cab82

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/apps/logger.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ const ANSI_COLOR_MAP: Record<number, string> = {
3333

3434
// 日志行匹配相关常量
3535
const LOG_TIME_PREFIX_REGEX = /^\[\d{2}:\d{2}:\d{2}\.\d{3}\]/
36-
const LOG_HEADER_REGEX = /^(\[\d{2}:\d{2}:\d{2}\.\d{3}\])(\[(?:INFO|WARN|ERROR|ERRO|FATAL|DEBUG|TRACE|MARK)\])/
36+
const LOG_HEADER_REGEX = /^(\[\d{2}:\d{2}:\d{2}\.\d{3}\])(\[(?:INFO|WARN|ERROR|ERRO|FATAL|DEBUG|DEBU|TRACE|MARK)\])/
3737

3838
const LOG_LEVEL_COLOR_CODE: Record<string, string> = {
3939
INFO: '\x1b[32m', // 绿色
4040
WARN: '\x1b[33m', // 黄色
4141
ERROR: '\x1b[31m', // 红色
4242
ERRO: '\x1b[31m', // 兼容旧字段
4343
FATAL: '\x1b[35m', // 紫色
44-
DEBUG: '\x1b[90m', // 灰色
44+
DEBUG: '\x1b[94m', // 淡蓝色
45+
DEBU: '\x1b[94m', // 淡蓝色(部分日志中使用 [DEBU] 缩写)
4546
TRACE: '\x1b[90m', // 灰色
4647
MARK: '\x1b[90m', // 灰色
4748
}

0 commit comments

Comments
 (0)