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 = {
9696} ;
9797
9898const logMethodFactory = function ( level ) {
99- return function ( action , data ) {
99+ return function ( action , data = { } ) {
100100 if ( ! this . _enabled ) {
101101 return ;
102102 }
Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ describe('Logger', function() {
3131 expect ( logArguments . details ) . to . eql ( 'forever' ) ;
3232 } ) ;
3333
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+
3443 it ( 'should not call log info method when disabled' , function ( ) {
3544 logger = new Logger ( 'mongo' , false ) ;
3645
You can’t perform that action at this time.
0 commit comments