Bug 1850247 - Add pref name to warning log. r=KrisWright

I could not have found the regressor without this.

Differential Revision: https://phabricator.services.mozilla.com/D186884
This commit is contained in:
Masatoshi Kimura
2023-08-31 16:58:12 +00:00
parent e101c29033
commit e740f7ed25

View File

@@ -2893,7 +2893,9 @@ nsPrefBranch::AddObserverImpl(const nsACString& aDomain, nsIObserver* aObserver,
mObservers.WithEntryHandle(pCallback.get(), [&](auto&& p) {
if (p) {
NS_WARNING("Ignoring duplicate observer.");
NS_WARNING(
nsPrintfCString("Ignoring duplicate observer: %s", prefName.get())
.get());
} else {
// We must pass a fully qualified preference name to the callback
// aDomain == nullptr is the only possible failure, and we trapped it with