bows
bows copied to clipboard
[Suggestion] Debug = false
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.
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?
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.
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 ;)
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
Have fixed the readme at least: https://github.com/latentflip/bows/commit/4c9a832096989a819aea9b8feff2a6c8a8ec095f but yeah, could probably rethink debug = "false" at some point. Would probably mean dropping andlog and just doing that stuff ourselves.