diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 265f4af2176c..9b6f53cc700b 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2186,11 +2186,15 @@ DOMGCSliceCallback(JSContext* aCx, JS::GCProgress aProgress, const JS::GCDescrip } if (sPostGCEventsToConsole) { - nsString gcstats; + NS_NAMED_LITERAL_STRING(kFmt, "[%s] "); + nsString prefix, gcstats; gcstats.Adopt(aDesc.formatSliceMessage(aCx)); + prefix.Adopt(nsTextFormatter::smprintf(kFmt.get(), + ProcessNameForCollectorLog())); + nsString msg = prefix + gcstats; nsCOMPtr cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID); if (cs) { - cs->LogStringMessage(gcstats.get()); + cs->LogStringMessage(msg.get()); } }