App.msg/warn/err events are not written to the log file and levels don't match

Đang mở
#264 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ó
4/5
Thời gian dự kiến
3-5 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
Sôi nổi
Công nghệ
java
Lĩnh vực
backend, documentation

Hướng nghiên cứu

Start by locating the App.msg(), App.warn() and App.err() definitions and searching their roughly 124 call sites for matching logger calls; the issue does not name source or test files. Read jdm-core/docs/benchmarks.md §4.1 for the warning and error semantics, then check whether existing logging tests cover event levels and duplicate lines. Done means event methods log at the specified levels, duplicate calls are removed while stack traces are retained, severity choices are reviewed, and the documentation is updated.

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

Mô tả

enhancement
Problem

App.msg(), App.warn() and App.err() only write to the Events tab (GUI) or the console (CLI). They never write to the log file (jdiskmark-0-0.log). Callers that want an event in the log must also call Logger themselves and pick a level by hand, so:

  • Events are missing from the log. Examples found while verifying #253 on Windows: the Keep Direct I/O choice, "Benchmark started/completed" and "Unable to delete test data" appeared in the Events tab but not in the log, which made the run hard to diagnose afterwards. Those specific lines were patched in #253, but any other App.* call without a matching logger call has the same gap.
  • Levels don't match. Some code pairs App.err() (red) with Level.WARNING, e.g. DriveChecker.checkDiskSpace() and the delete failure in BatchWorker.
  • Lines are duplicated by hand. Many call sites log a message and then pass the same text to App.*.

There are about 124 msg/warn/err call sites: roughly 47 App.err() and 3 App.warn(), the rest msg.

Proposed solution
  1. Have the App event methods log at a fixed matching level:

    App method Events tab Log level
    App.msg() normal INFO
    App.warn() amber WARNING
    App.err() red SEVERE
  2. Remove the logger calls that sit next to an App.* call with the same text, so lines aren't logged twice. Keep a logger call only when it adds a stack trace (e.g. LOG.log(Level.SEVERE, msg, e)), or offer an App.err(String, Throwable) overload for that.

  3. Review App.err() vs App.warn() choices so the colour reflects the severity. benchmarks.md §4.1 describes warn as recoverable and err as failures.

  4. Use a single logger (e.g. jdiskmark.App or an Events logger) so event lines are easy to filter in the log.

Notes
  • Verbose or high-frequency msg() output (e.g. per-run settings dumps) may need FINE instead of INFO to keep the log readable.
  • Update jdm-core/docs/benchmarks.md §4.1 (the App.warn()/App.err() paragraph) to describe the logging.
Ngôn ngữ chính
Java
Star
6
Fork
6
Merge trung bình
10 giờ 11 phút
Pull request đã merge (30 ngày)
12

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 JDiskMark/jdm-java

Tất cả issue của JDiskMark/jdm-java

Issue tương tự

Thêm issue về Java

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.