emrg: emrgd.log 日志友好化 — websockets DEBUG 降噪 + tool call 脱敏(rant 10:21:26) - #442
Merged
Conversation
…6-08-06T10:21:26)
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1022
作者 self-review(第 1 票):
- websockets 降噪:setLevel(INFO) 保留连接事件、滤帧级 DEBUG(实测 isEnabledFor: DEBUG False / INFO True)✓
- tool call 脱敏:_redact 递归替换 api_key/token/password/secret/key 等值为 ***(嵌套 dict/list 均覆盖)✓
- pytest 473 passed、import OK ✓
- 纯日志改动,不影响业务逻辑 ✓
无问题,可合并。
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1025
第 1 个独立周期确认(git diff ssh-origin/master...feature/log-friendliness 审查):
- websockets logger 设 INFO:滤掉帧级 DEBUG 收发(~90% 日志),保留连接建立/关闭事件——比 WARNING 更细、不丢生命周期信息 ✓
- _redact 递归脱敏:dict/list 中 api_key/token/authorization/password/secret/key 等敏感字段值替换 *** ✓
- tool call 日志应用脱敏(保留 [:200] 截断)✓
- 零业务逻辑改动(纯日志)✓
- CI test pass(32s)✓
无问题,可合并。合并条件进度:1/3(1025)
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1026
第 3 个独立周期确认(作者 self-review):
- websockets setLevel(INFO):保留连接事件、滤帧级 DEBUG(实测 DEBUG 抑制 / INFO+WARNING 保留)✓
- _redact 递归脱敏:api_key/token/password/secret/key 等字段 → ***(嵌套 dict/list 覆盖)✓
- tool call 日志截断 [:200] 保留 ✓
- pytest 473 passed、CI test pass(32s)✓
- 纯日志改动,不影响业务逻辑 ✓
无问题,可合并。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
实现 rant 2026-08-06T10:21:26(emrgd.log 日志友好化)。宿主反馈:emrgd.log 77355 行中 96.7% 是 DEBUG,其中 websockets 帧级收发日志 70057 行(90%)纯噪音,4 条真实 ERROR 被淹没。
1. websockets DEBUG 降噪(emrg/server/main.py):
logging.getLogger("websockets").setLevel(logging.INFO)2. tool call 日志脱敏(emrg/server/daemon.py):
_redact()递归函数:dict/list 中 api_key/token/authorization/password/secret/key 等敏感字段值替换为***验证
效果预期