New `logs` CLI command

Đang mở
#410 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
2.6k
Fork
222
Merge trung bình
16 giờ 23 phút
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rabbitstack/fibratus

Tất cả issue của rabbitstack/fibratus

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.