Skip to content

fix(logging): 調整正式版日誌門檻#41

Merged
perditavojo merged 2 commits into
mainfrom
dev
May 27, 2026
Merged

fix(logging): 調整正式版日誌門檻#41
perditavojo merged 2 commits into
mainfrom
dev

Conversation

@perditavojo
Copy link
Copy Markdown
Contributor

Release 預設只寫入 Warning 以上,Debug 與測試主機保留 Info 診斷。

同步調整 GameInput、震動與單實例診斷等級,並補上 LoggerService 與 GameInput 日誌邊界測試。

Release 預設只寫入 Warning 以上,Debug 與測試主機保留 Info 診斷。

同步調整 GameInput、震動與單實例診斷等級,並補上 LoggerService 與 GameInput 日誌邊界測試。
Copilot AI review requested due to automatic review settings May 27, 2026 03:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

此 PR 調整 InputBox 在 Release 預設只寫入 Warning 以上 的日誌策略,保留 Debug / 測試主機的 Info 診斷,同步收斂 GameInput、震動與單實例相關診斷的等級,並補上日誌門檻/邊界的測試與工程文件。

Changes:

  • LoggerService 新增日誌等級(Info/Warning/Error)與 INPUTBOX_LOG_LEVEL 覆寫機制,Release 預設門檻為 Warning。
  • 調整單實例、GameInput probe/diag、震動失敗等路徑的 log level(必要診斷升級為 Warning)。
  • 新增/擴充測試覆蓋 LoggerService 與 GameInput Release 日誌邊界,並更新工程文件與測試清單。

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/InputBox.Tests/README.md 更新測試清單描述與合計數,反映新增的日誌門檻/邊界測試。
tests/InputBox.Tests/LoggerServiceTests.cs 新增 Release-like 門檻解析、環境變數覆寫與寫入邊界測試,並加入測試用暫存 log 檔清理。
tests/InputBox.Tests/GameInputDirectUsageTests.cs 新增 GameInput 診斷原因分級(Info vs Warning)的邊界測試。
src/InputBox/Program.cs 單實例 fallback suppressed 路徑升級為 Warning,保留 detail 診斷。
src/InputBox/Core/Services/LoggerService.cs 引入 LogLevel、LogWarning/LogError、門檻解析與 ShouldWrite 寫入判斷。
src/InputBox/Core/Services/FeedbackService.cs 震動派送失敗新增 Warning 診斷。
src/InputBox/Core/Input/XInputGamepadController.cs 震動 API 失敗路徑提升為 Warning(Release 可見)。
src/InputBox/Core/Input/GameInputGamepadController.cs GameInput probe/diag 依可行動性調整 Info/Warning,震動失敗改為 Warning。
docs/engineering/gamepad-api.md 補充 GameInput Release 日誌邊界規範。
docs/engineering/core-engineering.md 明文化 Release 日誌門檻與「可行動診斷原則」。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/InputBox/Core/Services/LoggerService.cs
Comment thread tests/InputBox.Tests/LoggerServiceTests.cs
Comment thread tests/InputBox.Tests/GameInputDirectUsageTests.cs
快取 Debug 與測試主機判斷,避免每次寫入日誌時重複掃描程序與已載入組件。

同步統一 GameInput 日誌邊界測試命名,回應 PR review。
@perditavojo perditavojo merged commit 2ff39ae into main May 27, 2026
9 checks passed
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