Closed azpublic closed 1 year ago
Good point. I originally used the debug
library that you mention, but it was too heavy weight for me, so I created a lightweight version of it.
I'll implement a simple pattern matching for it, that makes sense.
I've implemented a very minimal filtering mechanism, I think that should do the trick:
(not yet published)
Fixed now in v0.17.7
Thanks a lot ! Will try it in a bit and let you know.
Hi!
My question is related to #253
I'm unable to disable jsonEditor's debug mechanism because my app uses the same debug mechanism as yours. I'm using the debug-js library (https://github.com/debug-js/debug) which relies on
localStorage.debug = 'MyApp:*'
to enable and filter the debugging / logging output.
In your code at :
https://github.com/josdejong/svelte-jsoneditor/blob/51c1d5441085581402cc916e9479c2c91d5c068e/src/lib/utils/debug.ts#LL25C43-L25C43
you use :
enabled = !!tryReadLocalStorage('debug')
which will always return true if there's anything inside localStorage.debug variable.
So I basically cant disable debugging for jsoneditor.
I there a way you could change the localstorage key ? Another option would be to make is as such that I could use debugjs syntax to disable it but that would require slightly more elaborate parsing.
For example :
localStorage.debug = 'MyApp: -jsoneditor:';
Thanks