From 472e793a279045bf00e8dcc325e21831ca43378f Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 25 Jan 2016 12:20:55 +0100 Subject: [PATCH] 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 9a9926667..2698c0e3b 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