对接日志默认仅记录告警与错误
新增 LOG_INTEGRATION_LEVEL(默认 warn),压低 integration-*.log 体积; 失败类文案自动提升为 error,避免异常被过滤。
This commit is contained in:
@@ -26,6 +26,13 @@ test('shouldWriteLog respects configured minimum log level', () => {
|
||||
assert.equal(shouldWriteLog('error', 'warn'), true)
|
||||
})
|
||||
|
||||
test('shouldWriteLog at warn filters info-style integration noise', () => {
|
||||
// 与默认 LOG_INTEGRATION_LEVEL=warn 行为一致
|
||||
assert.equal(shouldWriteLog('info', 'warn'), false)
|
||||
assert.equal(shouldWriteLog('warn', 'warn'), true)
|
||||
assert.equal(shouldWriteLog('error', 'warn'), true)
|
||||
})
|
||||
|
||||
test('resolveLogFilePath uses daily log file names by channel', () => {
|
||||
assert.match(resolveLogFilePath('app', '2026-05-28T00:00:19.194+08:00'), /app-2026-05-28\.log$/)
|
||||
assert.match(
|
||||
|
||||
Reference in New Issue
Block a user