I don't think there is a need for a fancy logger, but would be nice to have console.log, console.debug, ... in the code, but just print something on development mode. Since this is an extension, messing with the global console object does not seem the right approach. Perhaps we can add a wrapper class:
class Logger {
static isEnabled = true; // or false on production
static debug(...) {
Logger.isEnabled && console.debug(...);
}
}
With Gulp, and depending on the context, we should be able to enabled or disable the logging.
I don't think there is a need for a fancy logger, but would be nice to have
console.log
,console.debug
, ... in the code, but just print something on development mode. Since this is an extension, messing with the globalconsole
object does not seem the right approach. Perhaps we can add a wrapper class:With Gulp, and depending on the context, we should be able to enabled or disable the logging.