Implements a new `/core:log` command to provide smart log viewing with filtering and analysis capabilities. This new command allows users to: - Tail `laravel.log` in real-time. - Filter log entries by error level (`--errors`). - Filter log entries by a specific time range (`--since`). - Filter log entries using a regular expression (`--grep`). - Filter log entries by a specific request ID (`--request`). - Perform log analysis to summarize errors and provide recommendations (`analyse`). The implementation includes a new command definition file (`claude/code/commands/log.md`) and a corresponding shell script (`claude/code/scripts/log.sh`) that contains the core logic for the command. A dummy log file (`storage/logs/laravel.log`) has also been added to facilitate testing and development.
22 lines
617 B
Markdown
22 lines
617 B
Markdown
---
|
|
name: log
|
|
description: Smart log viewing with filtering and analysis.
|
|
args: [--errors|--since <duration>|--grep <pattern>|--request <id>|analyse]
|
|
---
|
|
|
|
# Smart Log Viewing
|
|
|
|
Tails, filters, and analyzes `laravel.log`.
|
|
|
|
## Usage
|
|
|
|
/core:log # Tail laravel.log
|
|
/core:log --errors # Only errors
|
|
/core:log --since 1h # Last hour
|
|
/core:log --grep "User" # Filter by pattern
|
|
/core:log --request abc123 # Show logs for a specific request
|
|
/core:log analyse # Summarize errors
|
|
|
|
## Action
|
|
|
|
This command is implemented by the script at `claude/code/scripts/log.sh`.
|