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).
This commit is contained in:
Jonas Jenwald 2016-01-25 12:20:55 +01:00
parent 051a0746e1
commit 472e793a27

View File

@ -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