feat(log): add structured logging support #311
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!311
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/structured-logging"
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
Add structured logging support to
log.lua:log.stage(name)— build stage progress entry (always visible)log.success(msg)— success messages (clean stderr + structured log)log.info(msg, { module = "...", pkg = "..." })Why
Completes Phase 2 logging enhancements. Enables structured log output with enriched context for debugging and traceability.
Changes
log.lua: New functions +format_ctx()helper + updatedlog.writevisibility rulesbuild.lua: Uses context param on build startcli.lua: Useslog.successfor done/activated/deactivatedTesting
luacheck— 0 warnings, 0 errorsBreaking Changes
None — backward compatible (context param is optional).
Closes #239
Review: PR #311 — Structured logging support
Verdict: Approved. Cleanly implements Phase 2 structured logging.
Changes verified
lib/qpkg/log.lua—format_ctx()helper, optionalctxparam on all log functions,log.stage(name)for build progress,log.success(msg)for success messages. Backward compatible —ctxdefaults to nil.lib/qpkg/log.lua:84-97—log.stage_start/log.stage_donenow also write to log file (addresses issue #310).lib/qpkg/log.lua:48—level == "stage"added to stderr visibility rule — build progress always visible.lib/qpkg/build.lua:197— Context table{ module = "build", pkg = ctx.pkg_id }on build start log.lib/qpkg/cli.lua:366,693,722—log.status("done.\n")→log.success("done")(fixes double-newline in log file).io.stderr:writefor activate/deactivate →log.success.ROADMAP2.md— #239 and subtasks #236-#238 correctly marked done.Observations
format_ctx(log.lua:35) usespairs()— non-deterministic key order. For current usage (single context with 2 keys) this is cosmetic, but sorted keys would produce consistent output if context tables grow.cli.lua:311-312"already installed" path still useslog.info(silent without--verbose), as tracked in issue #309.