New `logs` CLI command

Aperta
#410 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

Start by locating the Fibratus CLI command definitions and how the project reads its log file; the issue does not name specific files or tests. Check how existing commands parse flags, then identify the log path and available log format. Done means fibratus logs supports the requested modifiers and prints matching lines, with realtime tailing when -f is used.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs: docs scope: cli

Motivation

Examining the Fibratus logs can be a hassle, especially if the end user is not familiar with Powershell. It would be much more convenient if the Fibratus CLI provided the facilities for grepping log files, filtering relevant log messages, etc.

Feature

Expand the Fibratus CLI with a new logs command. The command should ideally provide the following set of modifiers:

  • -f: tails the log file in realtime as the file gets written by the Fibratus process
  • -n: shows the last N lines of the log file
  • -h: shows the first N lines of the log file
  • -l: filters the log messages by the log level (debug, info, warning, and error)
  • --grep: accepts the Go-compatible regular expression and applies on each log line. If it produces any match, the log line is shown on the console.

If the command is run without any modifiers, the entire log file is read and dumped on the console.

Examples:

Show last 10 lines and watch for subsequent changes in realtime:

$ fibratus logs -n 10 -f

Filter logs by info level

$ fibratus logs -l info

Additional context

For watching the file changes in realtime, consider the usage of the fsnotify package.

Lingua principale
Go
Stelle
2.6k
Fork
222
Merge medio
16h 23m
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rabbitstack/fibratus

Tutte le issue di rabbitstack/fibratus

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.