Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Entry.Level compared against DebugLevel is always false, so gated debug diagnostics never fire

Đang mở
#4,438 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
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go
Lĩnh vực
backend, observability

Hướng nghiên cứu

Bắt đầu với các kiểm tra tại auth/services/irma/signer.go:121, vcr/search.go:104 và storage/engine.go:428, đối chiếu chúng với mẫu đang hoạt động trong vcr/api/vcr/v2/registry.go:68. Xác minh rằng việc ghi log debug đã cấu hình sẽ bật mức độ chi tiết của QR, bản tóm tắt thông tin xác thực đã lọc và quá trình migration, trong khi việc thu thập header của HTTP request đã bị loại bỏ vẫn không xuất hiện.

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

Mô tả

auth bug storage vcr

The module log.Logger() helpers return a *logrus.Entry created with logrus.StandardLogger().WithField(...). Entry.Level is the per-message level, which logrus only sets on the entry copy used during an actual log call; on these long-lived entries it stays at the zero value, PanicLevel (0). A comparison like log.Logger().Level >= logrus.DebugLevel is therefore always 0 >= 5, i.e. false, regardless of the configured verbosity.

Three call sites gate debug diagnostics this way, so those diagnostics can never be enabled:

  • auth/services/irma/signer.go:121: the QR code for an IRMA session is never printed.
  • vcr/search.go:104: the debug summary of credentials filtered out of search results (error message counts) is never logged.
  • storage/engine.go:428: goose.SetVerbose() always receives false, so migration verbosity cannot be switched on.

None of these discloses anything; they are missing diagnostics only. The fix is to repair the check, for example with logrus.IsLevelEnabled(logrus.DebugLevel) as already used correctly at vcr/api/vcr/v2/registry.go:68 (valid because the module loggers wrap the standard logger), or log.Logger().Logger.IsLevelEnabled(...).

A fourth instance in the HTTP request logger gated request header capture, including the Authorization header. That one was removed rather than repaired in #4437, because enabling it would have written bearer tokens to the logs.

Ngôn ngữ chính
Go
Star
29
Fork
24
Merge trung bình
2 ngày 18 giờ
Pull request đã merge (30 ngày)
45

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

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 nuts-foundation/nuts-node

Tất cả issue của nuts-foundation/nuts-node

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.