@realvendex/pi-log

Structured logging and monitoring for pi.dev extensions — log piping, tailing, and rotation

Packages

Package details

extension

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, error
  • message (string, required) — The log message to record
  • transport (string, optional) — Where to write: memory (buffer only), file, console (default: memory)
  • format (string, optional) — Output format: json or pretty (default: pretty)
  • meta (object, optional) — Metadata key-value pairs to attach
  • source (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, error
  • since (string, optional) — ISO timestamp — only entries after this time
  • until (string, optional) — ISO timestamp — only entries before this time
  • search (string, optional) — Case-insensitive text search across message and source
  • limit (number, optional) — Max entries to return (default: 50, max: 500)
  • format (string, optional) — Output format: json or pretty (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 everything
    • level — Remove entries below a severity threshold
    • older-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) — For level strategy: entries below this are removed (default: info)
  • olderThan (string, optional) — For older-than strategy: duration string (default: 1h)
  • keepLast (number, optional) — For keep-last strategy: entries to keep (default: 100)

Example:

Use the log-clear tool with strategy="keep-last", keepLast=50

Resources

License

MIT