Skip to content

fix(essencefilter): migrate all logs to zerolog structured fields#1127

Merged
Joe-Bao merged 2 commits intofix/essencefrom
copilot/sub-pr-1125
Mar 8, 2026
Merged

fix(essencefilter): migrate all logs to zerolog structured fields#1127
Joe-Bao merged 2 commits intofix/essencefrom
copilot/sub-pr-1125

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

All 45 log statements in actions.go used <EssenceFilter> prefixes and embedded context (rule names, step labels) directly in Msg, violating the go-service zerolog convention.

Changes

  • Removed <EssenceFilter> prefix from every Msg string
  • Added Str("component", "EssenceFilter") to all log calls
  • Moved contextual identifiers to typed fields:
    • Rule names → Str("rule", "MatchSlot3Level3Practical") / Str("rule", "MatchFuturePromising")
    • Init steps → Str("step", "LoadMatcherConfig") / "LoadDatabase" / "LoadOptions" / "ValidatePresets" / "FilterWeapons" / "BuildSkillCombinations" (descriptive names instead of Step2Step7)
    • Action scope → Str("action", "CheckTotal") / "RowCollect" / "RowNextItem" / "CheckItem"
  • Msgs reduced to short English descriptions

Before / after example:

// Before
log.Info().
    Str("slot3_skill", matchResult.SkillsChinese[2]).
    Int("slot3_level", slot3Lv).
    Int("min_level", slot3MinLv).
    Msg("<EssenceFilter> MatchSlot3Level3Practical: 保留实用基质")

// After
log.Info().
    Str("component", "EssenceFilter").
    Str("rule", "MatchSlot3Level3Practical").
    Str("slot3_skill", matchResult.SkillsChinese[2]).
    Int("slot3_level", slot3Lv).
    Int("min_level", slot3MinLv).
    Msg("keep practical essence")

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Joe-Bao <114393786+Joe-Bao@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ability entry display issue in third line recognition fix(essencefilter): migrate all logs to zerolog structured fields Mar 8, 2026
@Joe-Bao Joe-Bao marked this pull request as ready for review March 8, 2026 19:33
@Joe-Bao Joe-Bao merged commit 6d0a44a into fix/essence Mar 8, 2026
15 checks passed
@Joe-Bao Joe-Bao deleted the copilot/sub-pr-1125 branch March 8, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants