File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ Logger.config = {
96
96
} ;
97
97
98
98
const logMethodFactory = function ( level ) {
99
- return function ( action , data ) {
99
+ return function ( action , data = { } ) {
100
100
if ( ! this . _enabled ) {
101
101
return ;
102
102
}
Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ describe('Logger', function() {
31
31
expect ( logArguments . details ) . to . eql ( 'forever' ) ;
32
32
} ) ;
33
33
34
+ it ( 'should be callable without the data object' , function ( ) {
35
+ logger . info ( 'wedidit' ) ;
36
+
37
+ const logArguments = JSON . parse ( Logger . config . output . args [ 0 ] ) ;
38
+ expect ( logArguments . name ) . to . eql ( 'mongo' ) ;
39
+ expect ( logArguments . action ) . to . eql ( 'wedidit' ) ;
40
+ expect ( logArguments . level ) . to . eql ( 30 ) ;
41
+ } ) ;
42
+
34
43
it ( 'should not call log info method when disabled' , function ( ) {
35
44
logger = new Logger ( 'mongo' , false ) ;
36
45
You can’t perform that action at this time.
0 commit comments