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] Debug = false #16

Open
sospedra opened this issue Apr 29, 2015 · 5 comments
Open

[Suggestion] Debug = false #16

sospedra opened this issue Apr 29, 2015 · 5 comments

Comments

@sospedra
Copy link

I'm using this awesome logger and then I realised that I cannot disable the logger setting the flag localStorage.debug to false. After the first time you set up this flag to true it'll remain until you clear your localStorage so, I think, that would be nice that the false value just run a simple localStorage.removeItem('debug').

Just saying, nice job by the way.

@latentflip
Copy link
Owner

I'm not sure what you mean? Do you mean if bows detects that you ran localStorage.debug = false instead of removeItem, then it'll delete the "false" for you?

@sospedra
Copy link
Author

I try to make it simplier ;)

As I tested if you put localStorage.debug = false it won't disable the logs. In the fact of, they still appearing. Because localStorage persist through the time.

So, I think that bows should run localStorage.removeItem('debug'). And the easiest way is by managing the debug flag as an option of bows; just like padLength.
This functionality will allow us to work with the environments easier. For example, being able to define npm scripts for production and development.

Or, maybe, bows is bugged and it doesn't work as expected.

@sospedra
Copy link
Author

After some investigation I notice that the flag manager is provided by andlog and they suggest delete the localStorage key instead of setting it to false. Maybe bows shouldn't manage this keeping in mind that the goal of this module is to provide the colours functionality to the front-end console.

So, this is now something up to you ;)

@ruiramos
Copy link

Setting localStorage.debug to false to disable logging won't work as, at least here in Chrome 47, it gets converted to "false" (the string). Not sure if you had that in mind @latentflip! Cheers

@latentflip
Copy link
Owner

Have fixed the readme at least: 4c9a832 but yeah, could probably rethink debug = "false" at some point. Would probably mean dropping andlog and just doing that stuff ourselves.

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

3 participants