@infra/logger

Universal structured logging with environment-aware configuration

v0.1.0

Modern logging solution built on Consola with automatic environment detection, structured JSON output, contextual logging, and seamless integration across both server and browser environments.

📊
Structured Logs
đŸŽ¯
Contextual
🌐
Universal
âš™ī¸
Environment Aware
Log Level Controls

Trigger different log levels and see how they appear with structured data

Active Log Level

Log level filter: Shows INFO and above (error > warn > info > debug)

Log Statistics
Total logs: 0
Visible: 0
Debug: 0
Info: 0
Warn: 0
Error: 0
Log Output

Real-time structured log entries with contextual data

No logs to display. Click buttons to generate logs.
💡 Tip:
Check your browser console to see the same logs with native browser formatting.
Package Features

Core Capabilities

  • ✓
    Universal logging (Node.js and browser)
  • ✓
    Structured JSON logs for easy parsing
  • ✓
    Environment-aware configuration
  • ✓
    Child loggers for contextual information
  • ✓
    Service-specific logger instances

Log Levels

  • DEBUG
    Detailed information for diagnosing problems
  • INFO
    General informational messages
  • WARN
    Warning messages for unexpected conditions
  • ERROR
    Error messages for serious problems
Environment Auto-Detection:
  • â€ĸ Development: Pretty console output with colors and human-readable timestamps
  • â€ĸ Staging: JSON output with info level logging and optional external transports
  • â€ĸ Production: JSON output with external integrations (Elasticsearch, CloudWatch, Datadog)
  • â€ĸ Browser: Console API with proper formatting and contextual information