Terminal Logging

Azu provides stunning, colorful performance reports that make monitoring your application's performance a visual delight. The beautiful terminal logging system transforms raw metrics into eye-catching, informative displays.

✨ Features Overview

🎨 Beautiful Report Formatting

  • Colorized output with semantic colors (green=good, yellow=warning, red=error)

  • Unicode box drawing characters for professional layouts

  • Emoji indicators for different metrics and sections

  • Visual progress bars for memory usage, response times, and error rates

  • Responsive layouts that adapt to terminal width

πŸ“Š Multiple Report Types

  • Full Detailed Report - Comprehensive performance analysis

  • Compact Summary - One-line performance overview

  • Health Check - Current system status

  • Time-based Reports - Hourly and daily performance summaries

πŸš€ Quick Start

Basic Usage

Integration in Your App

πŸ“‹ Report Types

1. Full Beautiful Report

The crown jewel of performance reporting - a comprehensive, beautifully formatted display:

Sample Output:

2. Compact Summary

Perfect for quick health checks or logging at the end of operations:

Sample Output:

3. Health Check

Monitor current system status with real-time metrics:

Sample Output:

4. Time-based Reports

Get performance summaries for specific time periods:

πŸŽ›οΈ Advanced Features

Periodic Reporting

Automatically log performance reports at regular intervals:

Signal Handling for Live Debugging

Add signal handlers for on-demand reporting:

HTTP Endpoints for Remote Monitoring

Access reports via HTTP endpoints (useful for monitoring dashboards):

Available endpoints in example app:

  • GET /performance/report - Logs beautiful report to terminal

  • GET /demo/reporting/full - Full detailed report

  • GET /demo/reporting/summary - Compact summary

  • GET /demo/reporting/health - Health check

  • GET /demo/reporting/help - Show available commands

🎨 Color Coding System

The beautiful reports use semantic colors to convey meaning at a glance:

Response Times

  • 🟒 Green (0-50ms) - Excellent performance

  • 🟑 Light Green (50-200ms) - Good performance

  • 🟠 Yellow (200-500ms) - Acceptable performance

  • πŸ”΄ Light Red (500-1000ms) - Slow performance

  • ⚫ Red (1000ms+) - Poor performance

Error Rates

  • 🟒 Green (0-1%) - Healthy error rate

  • 🟑 Yellow (1-5%) - Elevated error rate

  • πŸ”΄ Red (5%+) - High error rate

Memory Usage

  • 🟒 Green (0-1MB) - Low usage

  • 🟑 Light Green (1-5MB) - Normal usage

  • 🟠 Yellow (5-20MB) - Moderate usage

  • πŸ”΄ Light Red (20-50MB) - High usage

  • ⚫ Red (50MB+) - Very high usage

πŸ”§ Configuration

Environment Variables

Programmatic Configuration

πŸ“± Usage Examples

During Development

In Production Scripts

API Monitoring

🎭 Demo Script

Try the included demo script to see all features in action:

This demo creates sample performance data and showcases all the beautiful reporting features with realistic metrics.

πŸš€ Best Practices

When to Use Each Report Type

  1. Full Beautiful Report

    • End of day/week summaries

    • Performance analysis sessions

    • Debugging performance issues

    • Weekly team reviews

  2. Compact Summary

    • Application startup/shutdown

    • End of test runs

    • Quick health checks

    • Continuous monitoring scripts

  3. Health Check

    • Live monitoring dashboards

    • Automated health checks

    • Load balancer health endpoints

    • Real-time system status

Terminal Compatibility

The beautiful reports work best with:

  • Modern terminals that support Unicode and 256 colors

  • Terminal width of at least 80 characters

  • Color support enabled in your terminal

For systems without color support, the reports gracefully degrade to plain text while maintaining readability.

πŸ” Troubleshooting

Reports Not Showing Colors

Performance Impact

The beautiful reporting system is designed for minimal overhead:

  • Report generation: ~1-5ms depending on data size

  • Memory usage: Minimal, reports are generated on-demand

  • Production impact: Negligible when used appropriately

Common Issues

  1. Terminal width too narrow: Reports adapt but may wrap oddly

  2. Unicode not supported: Install fonts with Unicode support

  3. Colors not showing: Check terminal color support settings

πŸŽ‰ Conclusion

The beautiful terminal performance logging transforms mundane performance monitoring into an engaging, visual experience. Whether you're debugging issues, monitoring production systems, or just want to keep an eye on your application's health, these colorful, informative reports make performance data accessible and actionable.

The combination of semantic colors, visual progress bars, and well-organized layouts ensures that critical performance information is immediately apparent, helping you build faster, more reliable applications.

Last updated

Was this helpful?