Skip to content

Commit

Permalink
added a shunt flag to also mute logging errors to the console
Browse files Browse the repository at this point in the history
  • Loading branch information
dperini committed May 21, 2017
1 parent d02f630 commit da2d457
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/nwmatcher-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
emit =
function(message) {
if (Config.VERBOSITY) { throw Error(message); }
if (console && console.log) {
if (Config.LOGERRORS && console && console.log) {
console.log(message);
}
},
Expand All @@ -332,7 +332,8 @@
SIMPLENOT: true,
UNIQUE_ID: true,
USE_HTML5: true,
VERBOSITY: true
VERBOSITY: true,
LOGERRORS: true
},

initialize =
Expand Down
5 changes: 3 additions & 2 deletions src/nwmatcher-noqsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
emit =
function(message) {
if (Config.VERBOSITY) { throw Error(message); }
if (console && console.log) {
if (Config.LOGERRORS && console && console.log) {
console.log(message);
}
},
Expand All @@ -382,7 +382,8 @@
SIMPLENOT: true,
UNIQUE_ID: true,
USE_HTML5: true,
VERBOSITY: true
VERBOSITY: true,
LOGERRORS: true
},

initialize =
Expand Down
7 changes: 5 additions & 2 deletions src/nwmatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@
emit =
function(message) {
if (Config.VERBOSITY) { throw Error(message); }
if (console && console.log) {
if (Config.LOGERRORS && console && console.log) {
console.log(message);
}
},
Expand Down Expand Up @@ -879,7 +879,10 @@
USE_QSAPI: NATIVE_QSAPI,

// controls the engine error/warning notifications
VERBOSITY: true
VERBOSITY: true,

// true to print console errors or warnings, false to mute them
LOGERRORS: true

},

Expand Down

0 comments on commit da2d457

Please sign in to comment.