Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion: local storage enable/disable #22

Open
cmonacaps opened this issue Sep 10, 2020 · 0 comments
Open

suggestion: local storage enable/disable #22

cmonacaps opened this issue Sep 10, 2020 · 0 comments

Comments

@cmonacaps
Copy link

cmonacaps commented Sep 10, 2020

I like ololog a lot better than debug.

But one feature we use organizationally with debug is the local storage enablement.

Screen Shot 2020-09-10 at 4 24 33 PM

It may already be familiar to anyone reading this. But in case not, the way it works is with local storage debug missing or empty, all debug() output is disabled. If its value is *, all debug() output is enabled. Finally it can be set to a comma-separated list of context names, which correlate with require('debug')('context:name')('hello world').

This seems like 2 features unavailable with ololog - 1) local storage enablement and 2) named logging contexts.

If either or both of these features are actually available please just let me know. I'm not perfectly aware of everything ololog can do.

But the local storage enablement alone prevents me from using ololog in our frontend (react) apps.

Because I have a choice, I think, I can enable it or disable it in the build by using ololog.noop when NODE_ENV==='production' and configuring it as wanted otherwise. Or I can leave it enabled.

In the first case, if there's a problem in production, people will be upset we can't see the logging. In the second, the app will seem spammy, people here would prefer to not have logging output by default from our code.

If it seems like it might be possible to add one or both of these features I'd be willing to try to submit a PR according to whatever constraints you might have for it.

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

No branches or pull requests

1 participant