ivanseidel / ivanseidel/node-draftlog

Proposals for new version

オープン
#1 コメント 1 件 リアクション 6 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
1.2k
フォーク
33
PR マージ指標
30日以内にマージされた PR はありません

説明

`DraftLog` works. The API is simple. I want to keep it that way, but it might be improved with a few ideas.

Please, contribute by giving your insights, ideas and so on.

### `[1]` Avoid overriding `console._stdout`
Can we find a way to NOT put something in the middle of the Stream? Is it possible to 'listen' to data on a Writable stream? If so, that's all we need (we don't ever modify contents anyway)

### `[2]` Should we 'hook' draft method into `console`?
Hooking into console is really cool, but... To specific.

What if the person doesn't uses `console` to do logging, but writing to `stdout` directly?
In that case, it would cause two problems:

1. Draft method would be available only through custom instantiated `Console`. That's a bad requirement to ask developers... (Console is cool, but not a requirement for logging stuff)
2. If any data get's logged directly into `stdout`, then it would not capture that data. `[1]` would fix that, if just in listening mode.

### `[3]` Ideas for a new (and simpler) API

```javascript
const DraftLog = require('draftlog')
console.draft = DraftLog(process.stdout[, process.stdin])
// Or save to a custom function maybe
const draft = DraftLog(process.stdout[, process.stdin])

// Would make things easier in case of disabling:
if (PRODUCTION)
const draft = DraftLog();
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

この issue ではファイルもテストも指定されていないため、まず DraftLog の現在の API と console および stdout ストリームの扱いを確認します。提案されているストリーム監視と API の各オプションを比較し、その後どの設計を実装すべきかを明確にします。console、直接の stdout ロギング、無効化について動作が定義された合意済みの提案ができれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, node.js
領域
cli
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。