[Pkg-javascript-commits] [pdf.js] 28/119: Restrict logging of errors with verbosity level

David Prévot taffit at moszumanska.debian.org
Wed May 13 21:27:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit bdde3d66223181356e2101a39df15f925c11d776
Author: Andrew Dacenko <a.s.dvornik at gmail.com>
Date:   Sat Mar 28 21:44:41 2015 +0200

    Restrict logging of errors with verbosity level
---
 src/shared/util.js | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/shared/util.js b/src/shared/util.js
index 0224ab3..47736b0 100644
--- a/src/shared/util.js
+++ b/src/shared/util.js
@@ -208,17 +208,10 @@ function warn(msg) {
 // Fatal errors that should trigger the fallback UI and halt execution by
 // throwing an exception.
 function error(msg) {
-  // If multiple arguments were passed, pass them all to the log function.
-  if (arguments.length > 1) {
-    var logArguments = ['Error:'];
-    logArguments.push.apply(logArguments, arguments);
-    console.log.apply(console, logArguments);
-    // Join the arguments into a single string for the lines below.
-    msg = [].join.call(arguments, ' ');
-  } else {
+  if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) {
     console.log('Error: ' + msg);
+    console.log(backtrace());
   }
-  console.log(backtrace());
   UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown);
   throw new Error(msg);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list