Module: Make this.log default logger
Closed this issue · 1 comments
d-simon commented
I propose a small change, which will make the logger (bows) more intuitive and easier to use:
From this: /source/assets/js/helpers/module.js#L30
this.log = window.estatico.helpers.log;
To this:
this.log = window.estatico.helpers.log(this.name);
With this change the logger can directly be used inside a module:
this.log(importantLogData)
without having to "configure" it first.
Note: The log helper could still be exposed through the module, perhaps just with the "hidden" / "private" naming convention this._log
// "private" naming convention - if you really need multiple
// loggers in a module, you will know where to look. :-)
this._log = window.estatico.helpers.log;