AnalogJ/matchmedia-ng

DEVMODE should be false by default

rsrose21 opened this issue · 5 comments

Currently a config block is used to activate DEVMODE within the matchmedia-ng module. This forces the application owner to explicitly turn DEVMODE off by utilizing a separate config module at the application level. This additional config block will always be needed for production instances where logging should be turned off.

I suggest removing the config block within matchmedia-ng and allowing the application developer the option to add a config block at the application level instead.

Hey @rsrose21
Sorry I may just be misunderstanding, but DEVMODE is false by default. You shouldn't need to include the config module unless you want to explicitly enable it (so you don't need to include the config module in production code)

Yes, that's true. I was referencing the config block after the logger provider: https://github.com/AnalogJ/matchmedia-ng/blob/master/matchmedia-ng.js#L171

Because this config block executes: loggerProvider.setDEVMODE(true); logging is turned on by default. I need to explicitly include a separate config block and call setDEVMODE(false); to override this in the application.

If this config block was removed I wouldn't need the config block in my application layer (unless I wanted to turn logging on).

Thanks.

sigh. Good catch. I had that in there while I was testing, it was never supposed to be committed.
I'll remove it and bump up the version.

Thanks!

Cool. Much appreciated :)

Awesome work!

Hey @rsrose21 Sorry it took so long to get this fixed. I've been busy with some other stuff. v1.0.3 has dev mode disabled by default (and the logger block has been removed)