refactor the crate to separate the provided configurable formater and the optional custom formatter
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
調査の方向性
まず、issue で説明されている Builder API と Logger API をたどり、fmt::Builder とカスタムフォーマッタのパスを含めて確認します。現在のフォーマッタオプションを、提案されている build_with_custom_formatter と config_builder の設計と比較します。設定可能なフォーマッタがカスタムフォーマットから分離され、現在の API の不自然さがなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
This crate does three things:
- It parses environment variables into a verbosity configuration for individual modules (Env)
- It filters log messages against said configuration (Logger.filter)
- It provides a configurable formater (Logger.format)
You will generally read en environment, convert it to a filter and then combine the filter and a formater into a Logger which you install as default logger.
Technically all three are usable in isolation.
In practice almost everybody is using 2., most people will be using 1. with slight modifications to the default logging level, for example using verbosity flags in clis.
3 is the most commonly exchanged. This is reflected by the builder giving you the option of providing a custom formater.
This functionality should be moved to the Logger. If you want a custom formater you do not interact with the provided configurable formater in any way, but are still forced to use the type to create a Logger.
The current behaviour increases the internal complexity of the Builder struct and leads to weird api crincles. For example after calling Builder.format(|my| fn) technically every try to modify the configurable formatter (ex. format_level) should panic, as that is programmer error (unless ofc it is followed by a call to default_format).
This issue proposes to create a build_with_custom_formatter function instead. This would allow fmt::Builder to be retired.
Also since 90% of the api on the Builder is formatter options a single fn config_builder(|f: formatter|) could reduce duplication.
- 主要言語
- Rust
- スター
- 1.1k
- フォーク
- 150
- 平均マージ
- 3分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-cli/env_logger のほかの issue
-
Sanitization requires color, which parses every record再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
rust-cli/env_logger#419 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rust-cli/env_logger#379 · コメント 5 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rust-cli/env_logger#369 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-cli/env_logger#367 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rust-cli/env_logger#364 · コメント 11 件 · リアクション 2 件 ·
rust-cli/env_logger の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
storytold/photocraft#5710 ·
メンテナーはふだん 1 日以内に返信
-
Two tests fail on a Windows checkout: a CRLF parse in feature_walk_tests, an 8.3 TEMP path in libraries_tests対応中かも @CamWight が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bherbruck/solvecraft#1186 · コメント 1 件 ·
-
area: screenshot audit bug good first issue priority: P3 security severity: info type: correctness
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pierruno-labs/prowl#31 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
limitlessprojects/Go-Hybrid#50 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信