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

This commit is contained in:
David Taylor
2022-02-11 09:17:24 +00:00
parent af24c10314
commit c4e34047a1
2 changed files with 19 additions and 3 deletions

View File

@ -11,5 +11,13 @@ export default function deprecated(msg, opts = {}) {
if (opts.raiseError) {
throw msg;
}
console.warn(msg); // eslint-disable-line no-console
let consolePrefix = "";
if (window.Discourse) {
// This module doesn't exist in pretty-text/wizard/etc.
consolePrefix =
require("discourse/lib/source-identifier").consolePrefix() || "";
}
console.warn(consolePrefix, msg); //eslint-disable-line no-console
}