You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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)
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
constDraftLog=require('draftlog')console.draft=DraftLog(process.stdout[,process.stdin])// Or save to a custom function maybeconstdraft=DraftLog(process.stdout[,process.stdin])// Would make things easier in case of disabling:if(PRODUCTION)constdraft=DraftLog();
The text was updated successfully, but these errors were encountered:
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 overridingconsole._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 intoconsole
?Hooking into console is really cool, but... To specific.
What if the person doesn't uses
console
to do logging, but writing tostdout
directly?In that case, it would cause two problems:
Console
. That's a bad requirement to ask developers... (Console is cool, but not a requirement for logging stuff)stdout
, then it would not capture that data.[1]
would fix that, if just in listening mode.[3]
Ideas for a new (and simpler) APIThe text was updated successfully, but these errors were encountered: