@realvendex/pi-log
Structured logging and monitoring for pi.dev extensions — log piping, tailing, and rotation
Package details
Install @realvendex/pi-log from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@realvendex/pi-log- Package
@realvendex/pi-log- Version
1.0.0- Published
- Jun 27, 2026
- Downloads
- 115/mo · 7/wk
- Author
- realvendex
- License
- MIT
- Types
- extension
- Size
- 41.5 KB
- Dependencies
- 0 dependencies · 5 peers
Pi manifest JSON
{
"extensions": [
"./dist"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@realvendex/pi-log
Structured logging and monitoring for pi.dev extensions — log piping, tailing, and rotation.
Installation
pi install npm:@realvendex/pi-log
What It Does
pi-log provides structured logging tools for pi.dev extensions. It manages an in-memory log buffer with configurable severity levels, multiple output transports, and retention policies — perfect for debugging, monitoring, and audit trails in your pi.dev workflows.
Integration points: pi-config (log level config), pi-env-guard (audit trail), pi-perf (performance logging).
Tools
log-pipe
Write a structured log entry with configurable level, transport, and format.
Parameters:
level(string, required) — Severity:debug,info,warn,errormessage(string, required) — The log message to recordtransport(string, optional) — Where to write:memory(buffer only),file,console(default:memory)format(string, optional) — Output format:jsonorpretty(default:pretty)meta(object, optional) — Metadata key-value pairs to attachsource(string, optional) — Source label (e.g. tool name, module)filePath(string, optional) — File path for file transport (default:pi-log.jsonl)
Example:
Use the log-pipe tool with level="info", message="User authenticated", source="auth", meta={"userId": "abc"}
log-tail
Review recent log entries from the in-memory buffer with filtering.
Parameters:
level(string, optional) — Minimum level to include:debug,info,warn,errorsince(string, optional) — ISO timestamp — only entries after this timeuntil(string, optional) — ISO timestamp — only entries before this timesearch(string, optional) — Case-insensitive text search across message and sourcelimit(number, optional) — Max entries to return (default: 50, max: 500)format(string, optional) — Output format:jsonorpretty(default:pretty)
Example:
Use the log-tail tool with level="warn", limit=10
log-clear
Manage log storage by clearing entries from the in-memory buffer.
Parameters:
strategy(string, required) — Clearing strategy:all— Clear everythinglevel— Remove entries below a severity thresholdolder-than— Remove entries older than a duration (e.g.30s,5m,2h,7d)keep-last— Keep only the N most recent entries
minLevel(string, optional) — Forlevelstrategy: entries below this are removed (default:info)olderThan(string, optional) — Forolder-thanstrategy: duration string (default:1h)keepLast(number, optional) — Forkeep-laststrategy: entries to keep (default: 100)
Example:
Use the log-clear tool with strategy="keep-last", keepLast=50
Resources
License
MIT