Skip to content
This repository has been archived by the owner on Oct 7, 2019. It is now read-only.

Confusing millisecond diffs #1

Open
emschwartz opened this issue Jul 3, 2018 · 5 comments
Open

Confusing millisecond diffs #1

emschwartz opened this issue Jul 3, 2018 · 5 comments

Comments

@emschwartz
Copy link
Member

The debug modules includes millisecond diffs for each namespace. This module adds to each namespace such that debug('thingX:debug') and debug('thingX:error') will have unrelated diffs.

@emschwartz
Copy link
Member Author

To me, this suggests that adding stuff to the namespace isn't really the right way to use the debug module

@sharafian
Copy link
Collaborator

The main reason that we went for this approach is that lots of modules are too noisy, with no way to distinguish between different levels. When all the trace level stuff is marked, though, you can exclude everything ending in :trace.

Maybe a solution could be changing the output format of debug like what riverpig does, to add timestamps. The millisecond diffs are kinda unhelpful anyways

@emschwartz
Copy link
Member Author

See debug-js/debug#582 re: adding proper timestamps

@emschwartz
Copy link
Member Author

I think the purpose of the debug module is to be a super simple debugging tool, rather than a full-on logger. If the log output is being used in production and different logging levels are needed, why not switch to or add a proper logger? This module seems like a strange in-between

@sharafian
Copy link
Collaborator

If we used a regular logger, then logs on the info/error/warn levels would go to stdout/stderr even when the DEBUG flag isn't set. I agree that this module is in a kinda weird middle ground between debug and a normal logger, but if we went fully one way or another then our libraries would either be too noisy (with one debug level to toggle all messages) or would be annoying to use (if you import it as a library and it starts logging straight to stdout)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants