Skip to content

refactor: canonicalize logging into logger module#14

Merged
barrettruth merged 2 commits intomainfrom
refactor/logger-module
Mar 29, 2026
Merged

refactor: canonicalize logging into logger module#14
barrettruth merged 2 commits intomainfrom
refactor/logger-module

Conversation

@barrettruth
Copy link
Copy Markdown
Owner

Problem

Logging was scattered across 36 raw vim.notify() calls with inconsistent prefixes ([forge] vs [forge.nvim]), 6 calls missing log levels, 2 silent failure paths (PR/issue list JSON decode), and no debug mode.

Solution

Introduce forge.logger module with debug()/info()/warn()/error() helpers and a debug config option (boolean for vim.notify debug output, string for file logging). Replace every raw vim.notify('[forge]...') call site across all 7 files. Downgrade 4 internal-detail messages to debug-only. Add error handling for PR and issue list fetch failures. Add debug logging to detect().

Also fixes: ._by_name bug in :Forge pr dispatch, missing refresh action in checks picker, and per-check log showing all run logs instead of the selected job.

Closes #4

Problem: logging was scattered across 36 raw `vim.notify()` calls with
inconsistent prefixes (`[forge]` vs `[forge.nvim]`), missing levels,
no debug mode, and silent failures on JSON decode errors.

Solution: introduce `forge.logger` with `debug`/`info`/`warn`/`error`
helpers, a `debug` config option (`boolean` or file path), and replace
every call site. Downgrade internal-detail messages to debug-only. Add
error handling for PR and issue list fetch failures. Add debug logging
to `detect()` for diagnosing forge resolution. Fix `._by_name` bug in
`:Forge pr` dispatch, add missing `refresh` action to checks picker,
and pass `job_id` to `check_log_cmd` for per-check log filtering.
@barrettruth barrettruth merged commit 797dd98 into main Mar 29, 2026
7 checks passed
@barrettruth barrettruth deleted the refactor/logger-module branch March 29, 2026 16:17
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.

refactor: canonicalize logging into a logger module

1 participant