File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
1
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
+ } ,
2
10
log ( hash , ...args ) {
3
11
var middleware = ( ( hash && hash . middleware ) || [ ] ) . concat ( this . middleware ) ;
4
12
Original file line number Diff line number Diff line change @@ -6,23 +6,23 @@ class Logger {
6
6
}
7
7
8
8
extend ( options ) {
9
- return new Logger ( { ... this . options , ... options } ) ;
9
+ return new Logger ( Core . extend ( this . options , options ) ) ;
10
10
}
11
11
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 ) ) ) ;
14
14
}
15
15
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 ) ) ) ;
18
18
}
19
19
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 ) ) ) ;
22
22
}
23
23
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 ) ) ) ;
26
26
}
27
27
}
28
28
You can’t perform that action at this time.
0 commit comments