DEV: Prefix deprecation notices and api warnings with theme name/id

This commit is contained in:
David Taylor
2022-02-10 13:25:59 +00:00
parent c81d369ab6
commit a4ff69bd99
2 changed files with 17 additions and 3 deletions

View File

@ -11,5 +11,11 @@ export default function deprecated(msg, opts = {}) {
if (opts.raiseError) {
throw msg;
}
console.warn(msg); // eslint-disable-line no-console
// Using deferred `require` because this is discourse-specific logic which
// we don't want to run in pretty-text/wizard/etc.
const consolePrefix =
require("discourse/lib/source-identifier")?.consolePrefix() || "";
console.warn(consolePrefix, msg); //eslint-disable-line no-console
}