alexbrazier/simple-update-notifier

Introduce `debug` module style logging

voxpelli opened this issue ยท 3 comments

As a follow up to: #12

To make the debugging easier, I would suggest adopting either the debug module in itself or at least the syntax of DEBUG=simple-update-notifier / DEBUG=* to print out debug messages for failures here:

} catch {
// Catch any network errors or cache writing errors so module doesn't cause a crash
}

I realize that the point of this module is to have a small dependency footprint, so maybe do not add the debug module to do this.

I guess an alternative / simpler approach could also be to simply accept a debug: true flag into simpleUpdateNotifier() and do a console.error() within the catch only when that flag is set to true?

I think my preference would be for adding a flag like debug: true as the original aim of the package was to not have many dependencies.

@alexbrazier Want a PR?

@alexbrazier Want a PR?

Sure, if you're happy to create one ๐Ÿ˜€