feat(log): consolidate stderr writes into log module #308
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/qpkg!308
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/consolidate-stderr-writes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Audit all direct
io.stderr:writecalls across the codebase and route them through the log module.Why
Phase 2 logging consolidation. Every module now uses
log.*for user-facing output — zero direct stderr writes outsidecli.luacommand output andlog.luaimplementation.Changes
log.lua: Addlog.stage_start(name)andlog.stage_done(ok)for build progressbuild.lua:201-212: Replace direct stderr writes withlog.stage_start/log.stage_donecli.lua:311-314: Replaceio.stderr:writewithlog.infohash.lua/fetch.lua: Already addressed by Phase 1 (error returns instead of stderr writes)Testing
luacheck— 0 warnings, 0 errorsBreaking Changes
None.
Closes #235
Review: PR #308 — Consolidate stderr writes into log module
Verdict: Approved. Correctly implements Phase 2 logging consolidation.
Changes verified
lib/qpkg/log.lua:63-74—log.stage_start/log.stage_doneadded. Appropriate use of directio.stderr:writefor real-time progress output.lib/qpkg/build.lua:205-207—io.stderr:writereplaced withlog.stage_start/log.stage_done. Exact semantic match.lib/qpkg/cli.lua—errorsimport removed (no remaining references).io.stderr:write+errors.wrap_not_foundreplaced withlog.info. The oldwrap_not_found("package", ..., "already installed")was semantically incorrect (package was found, just installed) — the new message"X is already installed"is more accurate.ROADMAP2.md— #235 and subtasks #230-#234 correctly marked done.Non-blocking observation
cli.lua:311-312—log.infowrites to stderr only whenlog.verboseis true. The old code always showed the "already installed" message. At this point in the function,log.open()hasn't been called yet, so the message is also not written to the log file. Users runningqpkg install <pkg>on an already-installed package get no output (exit 0). If the intent is to always notify, considerlog.warn(always visible). If silent success is intentional, this is fine as-is.log.stage_start/log.stage_donewrite directly to stderr but don't log to file, unlikelog.statuswhich does both. Minor inconsistency — consider addinglog.write("progress", ...)calls if build progress should appear in log files.