[Pkg-javascript-commits] [pdf.js] 153/414: Always display `deprecated` messages, regardless of the verbosity setting
David Prévot
taffit at moszumanska.debian.org
Tue Jun 28 17:12:16 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 472e793a279045bf00e8dcc325e21831ca43378f
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Mon Jan 25 12:20:55 2016 +0100
Always display `deprecated` messages, regardless of the verbosity setting
Currently the `deprecated` message is using `warn`, meaning that it's possible to disable warnings about deprecated API usage through the `PDFJS.verbosity` setting.
I don't think that it should be possible to opt out of deprecation messages,[1] since it might mean that in a custom deployment of PDF.js these messages could be overlooked, leading to PDF.js being broken (seemingly without any warning) when updating to a future version.
Obviously this could be considered the responsibility of the people doing custom PDF.js implementations, but in order to reduce the support burden later on, it seems better to "annoy" people upfront.
Compared to various `info`/`warn`/`error` messages, `deprecated` messages should be very simple to get rid of -- just update the API usage and the message goes away!
---
[1] In e.g. Firefox it doesn't seem possible to prevent deprecation warnings from being displayed (in the Browser Console).
---
src/shared/util.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/shared/util.js b/src/shared/util.js
index 9a99266..2698c0e 100644
--- a/src/shared/util.js
+++ b/src/shared/util.js
@@ -246,9 +246,9 @@ function warn(msg) {
}
}
-// Deprecated API function -- treated as warnings.
+// Deprecated API function -- display regardless of the PDFJS.verbosity setting.
function deprecated(details) {
- warn('Deprecated API usage: ' + details);
+ console.log('Deprecated API usage: ' + details);
}
// Fatal errors that should trigger the fallback UI and halt execution by
--
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