fix(logs/config): BDS 级别 DRY + 剥前缀误判 + BOM/ensure 对齐 - #81
Merged
Tanya7z merged 1 commit intoJul 26, 2026
Conversation
pushLog 剥离 BDS 时间戳后,旧 getLogLevel 会把正文「Error on line」抬成 error。 将 parse/strip/map 收敛到 @sfmc-bds/sdk/logs;readJson 剥 BOM;log-filter 走 ensureSchemaConfig。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
This was referenced Jul 26, 2026
Tanya7z
marked this pull request as ready for review
July 26, 2026 11:05
Contributor
Author
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This was referenced Jul 26, 2026
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.
Summary
审查 main@
4ce2ea1(UTF-8 BOM 兼容、log-filter、BDS 日志格式化、落盘)后的 SOLID 债,直接补丁。本轮 push 的 ootb / changeset-release 均已 success,无新 wf 失败。
BLOCKER · LSP
pushLog剥离 BDS[时间 等级]后,resolveDisplayLevel→ 旧getLogLevel松散匹配会把正文Error on line抬成 error(已用 WARN 入库的行展示成 ERR)。改为:有时间戳前缀则parseBdsEmbeddedLevel,否则信任entry.level。MAJOR · DRY / DIP
sfmc 与 SDK
inferLevel各抄一份 BDS 正则+级别映射。现将mapBdsLevelToken/parseBdsEmbeddedLevel/stripBdsLogPrefix收敛到@sfmc-bds/sdk/logs,sfmc 再导出。MAJOR · DRY / LSP(BOM 契约)
本轮主题是剥 BOM,但 SDK
readJson仍不剥;log-filter手写JSON.parse(readFileSync)。readJson现与bds-tools/fsx.readJsonFile同契约;filter 走ensureSchemaConfig+readJson。MINOR
regex描述与实现(仅(?i)前缀)对齐getCompiledLogFilter无用bad[]未纳入(仍建议合 #80)
npm-publish / build-publishable 依赖拓扑、
scanDestOccupancy/DestOccupancy.kind等仍由 #80 覆盖。Test plan
node --test sfmc/log-filter.test.mjs sfmc/wrap-log-line.test.mjs bds-tools/world-packs.test.mjs(30 pass)resolveDisplayLevel对含Error的 WARN 行仍为warnreadJson读 BOM JSON → 正常对象