feat: Add comprehensive logging system with VERBOSE level#32
Open
poiley wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
I recommended merging the following PRs, rebasing this branch, and moving documentation to |
poiley
force-pushed
the
feat/comprehensive-logging
branch
2 times, most recently
from
September 2, 2025 21:39
e3d4a24 to
f76bb41
Compare
## Summary - Implement structured logging with multiple log types and levels - Add VERBOSE log level for detailed API call tracking - Replace --verbose-logging flag with cleaner log level system - Create comprehensive logging documentation ## Major Features - **Centralized logging module** (`logging_config.py`) with JSON formatting - **Five log levels**: ERROR, WARNING, INFO, VERBOSE, DEBUG - **Multiple log types**: main, API, analysis, debug with automatic rotation - **CLI integration**: `--log-level VERBOSE/DEBUG` and log viewer commands - **Real-time monitoring**: Built-in log viewer with follow mode ## API & Token Tracking - Detailed API call timing and success/failure logging - Rate limiting event tracking with backoff strategies - Token usage monitoring with cost calculations per phase - Fallback estimation logging when collector unavailable ## Enhanced CLI - Add `rulectl config logs` command with multiple viewing options - Support for custom log directories via `--log-dir` - Real-time log following with `--follow` option - Multiple log type filtering (main, api, analysis, debug) ## Documentation - Complete logging guide in LOGGING.md - Updated README with all new logging features and examples - Comprehensive usage examples and troubleshooting guides 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ehensive tests ## CLI Architecture Improvements - **BREAKING**: Move from `rulectl config logs` to direct `rulectl logs` command - Much more intuitive and follows industry standards (docker logs, kubectl logs) - Clean command separation: config=settings, logs=output, start=execution ## New Command Structure ```bash # New direct command (cleaner) rulectl logs --type api --follow # Instead of config logs --log-type # All logging options rulectl logs # Show recent main logs rulectl logs --type api # Show API logs rulectl logs --type analysis # Show analysis summaries rulectl logs --type debug # Show debug info rulectl logs --follow # Real-time following rulectl logs --lines 100 # More lines ``` ## Comprehensive Test Suite - **58 test cases** covering all logging functionality - Core logging tests (log levels, JSON formatting, structured logging) - CLI integration tests (options, commands, error handling) - API monitoring tests (rate limiter, token tracker, performance) - Test runner and documentation for easy maintenance ## Updated Documentation - All examples updated to use new `rulectl logs` command - Removed deprecated `--verbose-logging` and `config logs` references - Complete test documentation with usage examples - Architecture explanations for the CLI improvements ## Breaking Changes - `rulectl config logs` → `rulectl logs` (clean migration path) - `--log-type` → `--type` (shorter, cleaner option name) - Clear error messages guide users to new commands 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
poiley
force-pushed
the
feat/comprehensive-logging
branch
from
September 3, 2025 01:32
f76bb41 to
2d134e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a comprehensive logging system with improved CLI architecture, structured logging, and the new VERBOSE log level for detailed API tracking.
Related Issue: #35
🎯 Major Features
Comprehensive Logging System
logging_config.py) with JSON formatting~/.rulectl/logs/Enhanced CLI Architecture (BREAKING CHANGES)
rulectl logscommand (replacesrulectl config logs)VERBOSE Log Level
--verbose-loggingflag with cleaner log level systemComprehensive Test Suite
🔧 New CLI Commands
Log Viewing (NEW Direct Command)
Log Configuration (Enhanced)
📊 Enhanced API Monitoring
🗂️ Log Organization
~/.rulectl/logs/rulectl.log- General application events~/.rulectl/logs/api-calls-YYYY-MM.log- Detailed API tracking~/.rulectl/logs/analysis-YYYY-MM-DD.log- Daily summaries~/.rulectl/logs/debug.log- Technical debugging (JSON)🚨 Breaking Changes
CLI Command Changes
Removed Options
--verbose-loggingflag (replaced by--log-level VERBOSE)rulectl config logs(moved to directrulectl logs)Migration Guide
rulectl config logs→rulectl logs--log-type→--type--verbose-logging→--log-level VERBOSE💡 Benefits
📚 Documentation
LOGGING.mdtests/README.md🧪 Test Coverage
Test Results: 58 comprehensive test cases covering:
⚡ Performance
This implementation provides production-ready observability for rulectl with an intuitive CLI architecture that follows established patterns while maintaining comprehensive functionality.
🤖 Generated with Claude Code