Skip to content

Commit f4ecba5

Browse files
committed
Don't use any fancy ES6 constructs other than Class.
1 parent 15e3131 commit f4ecba5

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

core.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
module.exports = {
2+
extend() {
3+
return Array.prototype.reduce.call(arguments,function(accum,obj) {
4+
for(var k in obj) {
5+
accum[k] = obj[k];
6+
}
7+
return accum;
8+
},{});
9+
},
210
log(hash,...args) {
311
var middleware = ((hash && hash.middleware) || []).concat(this.middleware);
412

logger.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ class Logger {
66
}
77

88
extend(options) {
9-
return new Logger({ ...this.options, ...options });
9+
return new Logger(Core.extend(this.options,options));
1010
}
1111

12-
log(...args) {
13-
Core.log({ ...this.options, level: 'log' },...args);
12+
log() {
13+
Core.log.apply(Core,[Core.extend(this.options, { level: 'log' })].concat(Array.prototype.slice.call(arguments)));
1414
}
1515

16-
info(...args) {
17-
Core.log({ ...this.options, level: 'info' },...args);
16+
info() {
17+
Core.log.apply(Core,[Core.extend(this.options, { level: 'info' })].concat(Array.prototype.slice.call(arguments)));
1818
}
1919

20-
warn(...args) {
21-
Core.log({ ...this.options, level: 'warn' },...args);
20+
warn() {
21+
Core.log.apply(Core,[Core.extend(this.options, { level: 'warn' })].concat(Array.prototype.slice.call(arguments)));
2222
}
2323

24-
error(...args) {
25-
Core.log({ ...this.options, level: 'error' },...args);
24+
error() {
25+
Core.log.apply(Core,[Core.extend(this.options, { level: 'error' })].concat(Array.prototype.slice.call(arguments)));
2626
}
2727
}
2828

0 commit comments

Comments
 (0)