Skip to content
Snippets Groups Projects
Commit 10aabd12 authored by Guilherme Gazzo's avatar Guilherme Gazzo
Browse files

fix arguments logger

parent 9323473b
No related merge requests found
...@@ -78,7 +78,7 @@ const defaultTypes = { ...@@ -78,7 +78,7 @@ const defaultTypes = {
class _Logger { class _Logger {
constructor(name, config = {}) { constructor(name, config = {}) {
self = this; const self = this;
this.name = name; this.name = name;
this.config = Object.assign({}, config); this.config = Object.assign({}, config);
...@@ -141,12 +141,12 @@ class _Logger { ...@@ -141,12 +141,12 @@ class _Logger {
_.each(this.config.sections, (name, section) => { _.each(this.config.sections, (name, section) => {
this[section] = {}; this[section] = {};
_.each(defaultTypes, (typeConfig, type) => { _.each(defaultTypes, (typeConfig, type) => {
self[section][type] = () => self[type].apply({__section: name}, arguments); self[section][type] = (...args) => this[type].apply({__section: name}, args);
self[section][`${ type }_box`] = () => self[`${ type }_box`].apply({__section: name}, arguments); self[section][`${ type }_box`] = (...args) => this[`${ type }_box`].apply({__section: name}, args);
}); });
_.each(this.config.methods, (typeConfig, method) => { _.each(this.config.methods, (typeConfig, method) => {
self[section][method] = () => self[method].apply({__section: name}, arguments); self[section][method] = (...args) => self[method].apply({__section: name}, args);
self[section][`${ method }_box`] = () => self[`${ method }_box`].apply({__section: name}, arguments); self[section][`${ method }_box`] = (...args) => self[`${ method }_box`].apply({__section: name}, args);
}); });
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment