Skip to content

feat: add observability — log module, --verbose, file logging#68

Merged
Sunrisepeak merged 2 commits into
mainfrom
feat/observability
May 22, 2026
Merged

feat: add observability — log module, --verbose, file logging#68
Sunrisepeak merged 2 commits into
mainfrom
feat/observability

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

  • Add mcpp::log module with file-based logging, rotation, and verbose terminal output
  • Add global --verbose / -v flag that shows detailed progress on stderr
  • Add config.toml [log] section for persistent log configuration
  • Instrument key paths: toolchain install, package fetch, xlings events, probe

Usage

# Verbose output on stderr
mcpp --verbose toolchain install llvm 20.1.7

# File logging
MCPP_LOG_LEVEL=debug mcpp toolchain install llvm 20.1.7
cat ~/.mcpp/log/mcpp.log

# Persistent config in config.toml
[log]
level = "debug"

Test plan

  • --verbose build shows ninja verbose output
  • --verbose toolchain install shows install flow on stderr
  • MCPP_LOG_LEVEL=debug writes to ~/.mcpp/log/mcpp.log
  • Log rotation logic implemented
  • CI: Linux, macOS, Windows all pass

Three-layer observability system:

1. mcpp::log module (src/log.cppm):
   - File-based logging to ~/.mcpp/log/mcpp.log
   - Log rotation (10MB, 3 files)
   - Levels: off/error/warn/info/debug
   - Configured via MCPP_LOG_LEVEL env var or config.toml [log]

2. --verbose global flag:
   - Shows detailed progress on stderr (dim gray)
   - Auto-enables info-level file logging
   - Covers: toolchain install, package fetch, post-install fixup

3. Key path instrumentation:
   - Toolchain install flow (target, deps, fixup steps)
   - Package fetcher (resolve path, copy workaround, xlings calls)
   - xlings event forwarding (LogEvent, ErrorEvent)
   - Toolchain probing (compiler binary, sysroot, payload paths)
@Sunrisepeak Sunrisepeak merged commit 2dfcf48 into main May 22, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/observability branch May 22, 2026 12:42
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.

1 participant