types.ts: LoopCliConfig.logger docstring says 'VerboseLogger instance' but LoggerSpec accepts any Logger
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 92/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu trong src/types.ts, tại docstring của LoopCliConfig.logger, sau đó so sánh cách diễn đạt của nó với định nghĩa LoggerSpec trong src/loggers.ts và README hoặc hành vi của createLogger được đề cập trong issue. Cập nhật tài liệu để mô tả mọi triển khai Logger, tùy chọn 'verbose' và undefined; hoàn tất khi comment không còn ngụ ý rằng chỉ VerboseLogger được chấp nhận.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Observed behavior
The docstring on LoopCliConfig.logger in src/types.ts reads:
/**
* Controls verbose diagnostic logging to stderr. Accepts a concrete
* `VerboseLogger` instance, the string `'verbose'` (which creates an
* enabled logger), or `undefined` (quiet, the default).
*/
readonly logger?: LoggerSpec;
This says the field accepts a VerboseLogger instance. But LoggerSpec in src/loggers.ts is defined as:
export type LoggerSpec = Logger | 'verbose' | undefined;
Any object implementing the Logger interface is accepted, not just VerboseLogger. The README and createLogger implementation both treat the field as Logger | 'verbose' | undefined, so callers writing custom loggers will hit no runtime problem; they just see misleading documentation that suggests they have to use VerboseLogger.
Expected behavior
The docstring should describe the field as accepting any Logger implementation (with VerboseLogger mentioned as the built-in option), the string 'verbose', or undefined.
Minimal reproduction
Open src/types.ts and inspect the comment block on the logger field of LoopCliConfig (around line 103), then compare with the LoggerSpec definition in src/loggers.ts.
Suggested fix
Update the docstring to refer to Logger (the public interface) rather than VerboseLogger. For example:
Controls verbose diagnostic logging to stderr. Accepts a concrete
`Logger` instance, the string `'verbose'` (which creates an enabled
`VerboseLogger`), or `undefined` (quiet, the default).
- Ngôn ngữ chính
- TypeScript
- Star
- 2
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của joewalker/loop-the-loop
-
bug S4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal informationĐang mởbug S3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
joewalker/loop-the-loop#79 ·
Tất cả issue của joewalker/loop-the-loop
Issue tương tự
-
area: cli bug flake ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
gazetta-studio/gazetta-studio#1772 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
microsoft/playwright#43875 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
README translations: ja, ko, deĐang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
calagopus/panel#285 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày