mirror of
https://github.com/discourse/discourse.git
synced 2025-06-19 22:23:04 +08:00
DEV: Prefix deprecation notices and api warnings with theme name/id
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user