Bug 1165515 - Part 3: Convert PR_LOG_TEST to MOZ_LOG_TEST. r=froydnj
☠☠ backed out by 3f1f9238e02f ☠ ☠
authorEric Rahm <erahm@mozilla.com>
Mon, 01 Jun 2015 14:31:00 -0700
changeset 277371 0ec74176f8def91d7b05ed05a03c92dd6283eeaa
parent 277370 5b928dd10d717854168ab1af99cb62278374d415
child 277372 39be3db9597813a4bdd49475ef48c8d34b658d90
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1165515
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1165515 - Part 3: Convert PR_LOG_TEST to MOZ_LOG_TEST. r=froydnj
docshell/base/nsDocShell.cpp
docshell/shistory/nsSHistory.cpp
dom/base/nsContentPolicy.cpp
dom/base/nsDocument.cpp
dom/base/nsFocusManager.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsObjectLoadingContent.cpp
dom/events/IMEStateManager.cpp
dom/indexedDB/ProfilerHelpers.h
dom/media/AudioStream.cpp
dom/media/Latency.cpp
dom/media/directshow/SampleSink.cpp
dom/media/eme/EMEUtils.h
dom/media/systemservices/LoadManager.cpp
dom/media/systemservices/LoadMonitor.cpp
dom/media/systemservices/OpenSLESProvider.cpp
dom/media/webm/WebMReader.cpp
dom/media/webrtc/MediaEngineCameraVideoSource.cpp
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
dom/media/webrtc/MediaEngineWebRTCVideo.cpp
dom/network/UDPSocket.h
dom/network/UDPSocketChild.cpp
dom/network/UDPSocketParent.cpp
dom/security/nsCSPContext.cpp
dom/security/nsCSPParser.cpp
dom/security/nsCSPService.cpp
dom/security/nsCSPUtils.cpp
dom/xslt/xslt/txStylesheet.cpp
dom/xul/XULDocument.cpp
dom/xul/nsXULCommandDispatcher.cpp
dom/xul/nsXULContentSink.cpp
dom/xul/templates/nsContentTestNode.cpp
dom/xul/templates/nsRDFConInstanceTestNode.cpp
dom/xul/templates/nsRDFConMemberTestNode.cpp
dom/xul/templates/nsRDFPropertyTestNode.cpp
dom/xul/templates/nsXULContentBuilder.cpp
dom/xul/templates/nsXULTemplateBuilder.cpp
dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
extensions/auth/nsAuthGSSAPI.cpp
gfx/2d/Logging.h
gfx/layers/Layers.cpp
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFontEntry.cpp
gfx/thebes/gfxGDIFontList.cpp
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxUserFontSet.cpp
image/ProgressTracker.cpp
image/imgLoader.cpp
image/imgRequest.cpp
image/imgRequestProxy.cpp
js/xpconnect/src/XPCLog.cpp
layout/base/nsPresShell.cpp
layout/printing/nsPrintEngine.cpp
layout/style/FontFaceSet.cpp
layout/style/Loader.cpp
layout/style/nsFontFaceLoader.cpp
media/mtransport/logging.h
media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp
media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
modules/libjar/nsJARChannel.cpp
netwerk/base/BackgroundFileSaver.cpp
netwerk/base/nsDirectoryIndexStream.cpp
netwerk/base/nsLoadGroup.cpp
netwerk/base/nsSocketTransportService2.h
netwerk/base/nsStandardURL.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cache2/CacheLog.h
netwerk/cookie/nsCookieService.cpp
netwerk/protocol/http/HttpLog.h
netwerk/protocol/res/nsResProtocolHandler.cpp
netwerk/protocol/wyciwyg/nsWyciwyg.h
netwerk/sctp/datachannel/DataChannel.cpp
netwerk/socket/nsSOCKSIOLayer.cpp
rdf/base/nsInMemoryDataSource.cpp
rdf/base/nsRDFContentSink.cpp
rdf/base/nsRDFXMLDataSource.cpp
security/manager/ssl/nsNTLMAuthModule.cpp
security/manager/ssl/nsSecureBrowserUIImpl.cpp
storage/VacuumManager.cpp
storage/mozStorageConnection.cpp
storage/mozStorageStatement.cpp
toolkit/components/downloads/ApplicationReputation.cpp
toolkit/components/url-classifier/Classifier.cpp
toolkit/components/url-classifier/HashStore.cpp
toolkit/components/url-classifier/LookupCache.cpp
toolkit/components/url-classifier/ProtocolParser.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
uriloader/base/nsDocLoader.cpp
uriloader/base/nsURILoader.cpp
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/unix/nsOSHelperAppService.cpp
uriloader/prefetch/OfflineCacheUpdateChild.cpp
uriloader/prefetch/OfflineCacheUpdateGlue.cpp
uriloader/prefetch/OfflineCacheUpdateParent.cpp
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
uriloader/prefetch/nsPrefetchService.cpp
widget/cocoa/NativeKeyBindings.mm
widget/cocoa/TextInputHandler.mm
widget/windows/KeyboardLayout.cpp
widget/windows/WinMouseScrollHandler.cpp
widget/windows/nsTextStore.cpp
xpcom/components/nsComponentManager.cpp
xpcom/components/nsNativeModuleLoader.cpp
xpcom/threads/TimerThread.cpp
xpcom/threads/nsTimerImpl.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1413,17 +1413,17 @@ nsDocShell::LoadURI(nsIURI* aURI,
     aLoadInfo->GetReferrerPolicy(&referrerPolicy);
     aLoadInfo->GetIsSrcdocLoad(&isSrcdoc);
     aLoadInfo->GetSrcdocData(srcdoc);
     aLoadInfo->GetSourceDocShell(getter_AddRefs(sourceDocShell));
     aLoadInfo->GetBaseURI(getter_AddRefs(baseURI));
   }
 
 #if defined(DEBUG)
-  if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
     nsAutoCString uristr;
     aURI->GetAsciiSpec(uristr);
     MOZ_LOG(gDocShellLog, PR_LOG_DEBUG,
            ("nsDocShell[%p]: loading %s with flags 0x%08x",
             this, uristr.get(), aLoadFlags));
   }
 #endif
 
@@ -1975,17 +1975,17 @@ nsDocShell::SetCurrentURI(nsIURI* aURI)
   SetCurrentURI(aURI, nullptr, true, 0);
   return NS_OK;
 }
 
 bool
 nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
                           bool aFireOnLocationChange, uint32_t aLocationFlags)
 {
-  if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
+  if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
     nsAutoCString spec;
     if (aURI) {
       aURI->GetSpec(spec);
     }
     PR_LogPrint("DOCSHELL %p SetCurrentURI %s\n", this, spec.get());
   }
 
   // We don't want to send a location change when we're displaying an error
@@ -5297,17 +5297,17 @@ NS_IMETHODIMP
 nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
                           const char* aErrorPage,
                           const char16_t* aErrorType,
                           const char16_t* aDescription,
                           const char* aCSSClass,
                           nsIChannel* aFailedChannel)
 {
 #if defined(DEBUG)
-  if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
     nsAutoCString spec;
     aURI->GetSpec(spec);
 
     nsAutoCString chanName;
     if (aFailedChannel) {
       aFailedChannel->GetName(chanName);
     } else {
       chanName.AssignLiteral("<no channel>");
@@ -9601,17 +9601,17 @@ nsDocShell::InternalLoad(nsIURI* aURI,
                          nsIDocShell* aSourceDocShell,
                          nsIURI* aBaseURI,
                          nsIDocShell** aDocShell,
                          nsIRequest** aRequest)
 {
   nsresult rv = NS_OK;
   mOriginalUriString.Truncate();
 
-  if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
+  if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
     nsAutoCString spec;
     if (aURI) {
       aURI->GetSpec(spec);
     }
     PR_LogPrint("DOCSHELL %p InternalLoad %s\n", this, spec.get());
   }
   // Initialize aDocShell/aRequest
   if (aDocShell) {
@@ -11160,17 +11160,17 @@ bool
 nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner,
                      uint32_t aLoadType, bool aFireOnLocationChange,
                      bool aAddToGlobalHistory, bool aCloneSHChildren)
 {
   NS_PRECONDITION(aURI, "uri is null");
   NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set");
 
 #if defined(DEBUG)
-  if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
     nsAutoCString spec;
     aURI->GetSpec(spec);
 
     nsAutoCString chanName;
     if (aChannel) {
       aChannel->GetName(chanName);
     } else {
       chanName.AssignLiteral("<no channel>");
@@ -11780,17 +11780,17 @@ nsresult
 nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
                                 nsISupports* aOwner, bool aCloneChildren,
                                 nsISHEntry** aNewEntry)
 {
   NS_PRECONDITION(aURI, "uri is null");
   NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set");
 
 #if defined(DEBUG)
-  if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) {
     nsAutoCString spec;
     aURI->GetSpec(spec);
 
     nsAutoCString chanName;
     if (aChannel) {
       aChannel->GetName(chanName);
     } else {
       chanName.AssignLiteral("<no channel>");
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -73,17 +73,17 @@ GetSHistoryLog()
 // This macro makes it easier to print a log message which includes a URI's
 // spec.  Example use:
 //
 //  nsIURI *uri = [...];
 //  LOG_SPEC(("The URI is %s.", _spec), uri);
 //
 #define LOG_SPEC(format, uri)                              \
   PR_BEGIN_MACRO                                           \
-    if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) {     \
+    if (MOZ_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) {     \
       nsAutoCString _specStr(NS_LITERAL_CSTRING("(null)"));\
       if (uri) {                                           \
         uri->GetSpec(_specStr);                            \
       }                                                    \
       const char* _spec = _specStr.get();                  \
       LOG(format);                                         \
     }                                                      \
   PR_END_MACRO
@@ -91,17 +91,17 @@ GetSHistoryLog()
 // This macro makes it easy to log a message including an SHEntry's URI.
 // For example:
 //
 //  nsCOMPtr<nsISHEntry> shentry = [...];
 //  LOG_SHENTRY_SPEC(("shentry %p has uri %s.", shentry.get(), _spec), shentry);
 //
 #define LOG_SHENTRY_SPEC(format, shentry)                  \
   PR_BEGIN_MACRO                                           \
-    if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) {     \
+    if (MOZ_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) {     \
       nsCOMPtr<nsIURI> uri;                                \
       shentry->GetURI(getter_AddRefs(uri));                \
       LOG_SPEC(format, uri);                               \
     }                                                      \
   PR_END_MACRO
 
 // Iterates over all registered session history listeners.
 #define ITERATE_LISTENERS(body)                            \
--- a/dom/base/nsContentPolicy.cpp
+++ b/dom/base/nsContentPolicy.cpp
@@ -183,17 +183,17 @@ nsContentPolicy::CheckPolicy(CPMethod   
     return NS_OK;
 }
 
 //uses the parameters from ShouldXYZ to produce and log a message
 //logType must be a literal string constant
 #define LOG_CHECK(logType)                                                    \
   PR_BEGIN_MACRO                                                              \
     /* skip all this nonsense if the call failed or logging is disabled */    \
-    if (NS_SUCCEEDED(rv) && PR_LOG_TEST(gConPolLog, PR_LOG_DEBUG)) {          \
+    if (NS_SUCCEEDED(rv) && MOZ_LOG_TEST(gConPolLog, PR_LOG_DEBUG)) {          \
       const char *resultName;                                                 \
       if (decision) {                                                         \
         resultName = NS_CP_ResponseName(*decision);                           \
       } else {                                                                \
         resultName = "(null ptr)";                                            \
       }                                                                       \
       nsAutoCString spec("None");                                             \
       if (contentLocation) {                                                  \
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -2300,17 +2300,17 @@ nsDocument::Reset(nsIChannel* aChannel, 
 }
 
 void
 nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
                        nsIPrincipal* aPrincipal)
 {
   NS_PRECONDITION(aURI, "Null URI passed to ResetToURI");
 
-  if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
+  if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
     nsAutoCString spec;
     aURI->GetSpec(spec);
     PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get());
   }
 
   mSecurityInfo = nullptr;
 
   mDocumentLoadGroup = nullptr;
@@ -2633,17 +2633,17 @@ WarnIfSandboxIneffective(nsIDocShell* aD
 
 nsresult
 nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
                               nsILoadGroup* aLoadGroup,
                               nsISupports* aContainer,
                               nsIStreamListener **aDocListener,
                               bool aReset, nsIContentSink* aSink)
 {
-  if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
+  if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
     nsCOMPtr<nsIURI> uri;
     aChannel->GetURI(getter_AddRefs(uri));
     nsAutoCString spec;
     if (uri)
       uri->GetSpec(spec);
     PR_LogPrint("DOCUMENT %p StartDocumentLoad %s", this, spec.get());
   }
 
@@ -2861,17 +2861,17 @@ nsDocument::InitCSP(nsIChannel* aChannel
  bool applyLoopCSP = IsLoopDocument(aChannel);
 
   // If there's no CSP to apply, go ahead and return early
   if (!applyAppDefaultCSP &&
       !applyAppManifestCSP &&
       !applyLoopCSP &&
       cspHeaderValue.IsEmpty() &&
       cspROHeaderValue.IsEmpty()) {
-    if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
       nsCOMPtr<nsIURI> chanURI;
       aChannel->GetURI(getter_AddRefs(chanURI));
       nsAutoCString aspec;
       chanURI->GetAsciiSpec(aspec);
       MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
              ("no CSP for document, %s, %s",
               aspec.get(),
               applyAppDefaultCSP ? "is app" : "not an app"));
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -76,17 +76,17 @@ using namespace mozilla::widget;
 //   'FocusNavigation' for tab and document navigation
 PRLogModuleInfo* gFocusLog;
 PRLogModuleInfo* gFocusNavigationLog;
 
 #define LOGFOCUS(args) MOZ_LOG(gFocusLog, PR_LOG_DEBUG, args)
 #define LOGFOCUSNAVIGATION(args) MOZ_LOG(gFocusNavigationLog, PR_LOG_DEBUG, args)
 
 #define LOGTAG(log, format, content)                            \
-  if (PR_LOG_TEST(log, PR_LOG_DEBUG)) {                         \
+  if (MOZ_LOG_TEST(log, PR_LOG_DEBUG)) {                         \
     nsAutoCString tag(NS_LITERAL_CSTRING("(none)"));            \
     if (content) {                                              \
       content->NodeInfo()->NameAtom()->ToUTF8String(tag);       \
     }                                                           \
     MOZ_LOG(log, PR_LOG_DEBUG, (format, tag.get()));             \
   }
 
 #define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content)
@@ -477,17 +477,17 @@ nsFocusManager::ElementIsFocusable(nsIDO
 NS_IMETHODIMP
 nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
                           uint32_t aType, uint32_t aFlags, nsIDOMElement** aElement)
 {
   *aElement = nullptr;
 
   LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
 
-  if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
+  if (MOZ_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
     nsIDocument* doc = mFocusedWindow->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
       nsAutoCString spec;
       doc->GetDocumentURI()->GetSpec(spec);
       LOGFOCUS((" Focused Window: %p %s", mFocusedWindow.get(), spec.get()));
     }
   }
 
@@ -633,17 +633,17 @@ nsFocusManager::MoveCaretToFocus(nsIDOMW
 }
 
 NS_IMETHODIMP
 nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
   NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
 
-  if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
     LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
     nsAutoCString spec;
     nsIDocument* doc = window->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
       doc->GetDocumentURI()->GetSpec(spec);
       LOGFOCUS(("  Raised Window: %p %s", aWindow, spec.get()));
     }
     if (mActiveWindow) {
@@ -729,17 +729,17 @@ nsFocusManager::WindowRaised(nsIDOMWindo
 }
 
 NS_IMETHODIMP
 nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
   NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
 
-  if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
     LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
     nsAutoCString spec;
     nsIDocument* doc = window->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
       doc->GetDocumentURI()->GetSpec(spec);
       LOGFOCUS(("  Lowered Window: %s", spec.get()));
     }
     if (mActiveWindow) {
@@ -847,17 +847,17 @@ nsFocusManager::ContentRemoved(nsIDocume
 NS_IMETHODIMP
 nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
   NS_ENSURE_TRUE(window, NS_ERROR_INVALID_ARG);
 
   window = window->GetOuterWindow();
 
-  if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
     LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
     nsAutoCString spec;
     nsIDocument* doc = window->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
       doc->GetDocumentURI()->GetSpec(spec);
       LOGFOCUS(("Shown Window: %s", spec.get()));
     }
 
@@ -902,17 +902,17 @@ nsFocusManager::WindowHidden(nsIDOMWindo
   // currently focused window, just return, as the current focus will not
   // be affected.
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
   NS_ENSURE_TRUE(window, NS_ERROR_INVALID_ARG);
 
   window = window->GetOuterWindow();
 
-  if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
     LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
     nsAutoCString spec;
     nsIDocument* doc = window->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
       doc->GetDocumentURI()->GetSpec(spec);
       LOGFOCUS(("  Hide Window: %s", spec.get()));
     }
 
@@ -1772,17 +1772,17 @@ nsFocusManager::Focus(nsPIDOMWindow* aWi
   bool clearFirstFocusEvent = false;
   if (!mFirstFocusEvent) {
     mFirstFocusEvent = aContent;
     clearFirstFocusEvent = true;
   }
 
   LOGCONTENT("Element %s has been focused", aContent);
 
-  if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
     nsIDocument* docm = aWindow->GetExtantDoc();
     if (docm) {
       LOGCONTENT(" from %s", docm->GetRootElement());
     }
     LOGFOCUS((" [Newdoc: %d FocusChanged: %d Raised: %d Flags: %x]",
              aIsNewDocument, aFocusChanged, aWindowRaised, aFlags));
   }
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -2799,17 +2799,17 @@ nsGlobalWindow::ClearStatus()
 }
 
 void
 nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
 {
   NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows");
   MOZ_ASSERT(aDocument);
 
-  if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
+  if (gDOMLeakPRLog && MOZ_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
     nsIURI *uri = aDocument->GetDocumentURI();
     nsAutoCString spec;
     if (uri)
       uri->GetSpec(spec);
     PR_LogPrint("DOMWINDOW %p SetNewDocument %s", this, spec.get());
   }
 
   mDoc = aDocument;
@@ -10553,17 +10553,17 @@ nsGlobalWindow::GetSessionStorage(ErrorR
   nsIPrincipal *principal = GetPrincipal();
   nsIDocShell* docShell = GetDocShell();
 
   if (!principal || !docShell || !Preferences::GetBool(kStorageEnabled)) {
     return nullptr;
   }
 
   if (mSessionStorage) {
-    if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
       PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get());
     }
     bool canAccess = mSessionStorage->CanAccess(principal);
     NS_ASSERTION(canAccess,
                  "This window owned sessionStorage "
                  "that could not be accessed!");
     if (!canAccess) {
       mSessionStorage = nullptr;
@@ -10604,27 +10604,27 @@ nsGlobalWindow::GetSessionStorage(ErrorR
                                            getter_AddRefs(storage));
     if (aError.Failed()) {
       return nullptr;
     }
 
     mSessionStorage = static_cast<DOMStorage*>(storage.get());
     MOZ_ASSERT(mSessionStorage);
 
-    if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
       PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get());
     }
 
     if (!mSessionStorage) {
       aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
       return nullptr;
     }
   }
 
-  if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
     PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get());
   }
 
   return mSessionStorage;
 }
 
 NS_IMETHODIMP
 nsGlobalWindow::GetSessionStorage(nsISupports** aSessionStorage)
@@ -11532,17 +11532,17 @@ nsGlobalWindow::Observe(nsISupports* aSu
       }
 
       if (!check) {
         // This storage event is not coming from our storage or is coming
         // from a different docshell, i.e. it is a clone, ignore this event.
         return NS_OK;
       }
 
-      if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
+      if (MOZ_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
         PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p",
                     this, mSessionStorage.get(), changingStorage.get());
       }
 
       fireMozStorageChanged = mSessionStorage == changingStorage;
       break;
     }
 
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -112,17 +112,17 @@ GetObjectLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("objlc");
   return sLog;
 }
 
 #define LOG(args) MOZ_LOG(GetObjectLog(), PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)
 
 static bool
 IsJavaMIME(const nsACString & aMIMEType)
 {
   return
     nsPluginHost::GetSpecialType(aMIMEType) == nsPluginHost::eSpecialType_Java;
 }
 
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -501,17 +501,17 @@ IMEStateManager::OnMouseButtonEventInEdi
       ("ISM:   IMEStateManager::OnMouseButtonEventInEditor(), "
        "the internal event of aMouseEvent isn't WidgetMouseEvent"));
     return false;
   }
 
   bool consumed =
     sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent);
 
-  if (PR_LOG_TEST(sISMLog, PR_LOG_ALWAYS)) {
+  if (MOZ_LOG_TEST(sISMLog, PR_LOG_ALWAYS)) {
     nsAutoString eventType;
     aMouseEvent->GetType(eventType);
     MOZ_LOG(sISMLog, PR_LOG_ALWAYS,
       ("ISM:   IMEStateManager::OnMouseButtonEventInEditor(), "
        "mouse event (type=%s, button=%d) is %s",
        NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
        consumed ? "consumed" : "not consumed"));
   }
--- a/dom/indexedDB/ProfilerHelpers.h
+++ b/dom/indexedDB/ProfilerHelpers.h
@@ -279,17 +279,17 @@ LoggingHelper(bool aUseProfiler, const c
                IndexedDatabaseManager::Logging_Disabled);
   MOZ_ASSERT(aFmt);
 
   PRLogModuleInfo* logModule = IndexedDatabaseManager::GetLoggingModule();
   MOZ_ASSERT(logModule);
 
   static const PRLogModuleLevel logLevel = PR_LOG_WARNING;
 
-  if (PR_LOG_TEST(logModule, logLevel) ||
+  if (MOZ_LOG_TEST(logModule, logLevel) ||
       (aUseProfiler && profiler_is_active())) {
     nsAutoCString message;
 
     {
       va_list args;
       va_start(args, aFmt);
 
       message.AppendPrintf(aFmt, args);
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -607,17 +607,17 @@ AudioStream::Write(const AudioDataValue*
   else if (mChannels > 8) {
     return NS_ERROR_FAILURE;
   }
 
   const uint8_t* src = reinterpret_cast<const uint8_t*>(aBuf);
   uint32_t bytesToCopy = FramesToBytes(aFrames);
 
   // XXX this will need to change if we want to enable this on-the-fly!
-  if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
     // Record the position and time this data was inserted
     int64_t timeMs;
     if (aTime && !aTime->IsNull()) {
       if (mStartTime.IsNull()) {
         AsyncLatencyLogger::Get(true)->GetStartTime(mStartTime);
       }
       timeMs = (*aTime - mStartTime).ToMilliseconds();
     } else {
@@ -1128,17 +1128,17 @@ AudioStream::DataCallback(void* aBuffer,
     }
     servicedFrames += underrunFrames;
   } else {
     mAudioClock.UpdateFrameHistory(servicedFrames, 0);
   }
 
   WriteDumpFile(mDumpFile, this, aFrames, aBuffer);
   // Don't log if we're not interested or if the stream is inactive
-  if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG) &&
+  if (MOZ_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG) &&
       mState != SHUTDOWN &&
       insertTime != INT64_MAX && servicedFrames > underrunFrames) {
     uint32_t latency = UINT32_MAX;
     if (cubeb_stream_get_latency(mCubebStream.get(), &latency)) {
       NS_WARNING("Could not get latency from cubeb.");
     }
     TimeStamp now = TimeStamp::Now();
 
--- a/dom/media/Latency.cpp
+++ b/dom/media/Latency.cpp
@@ -211,15 +211,15 @@ int64_t AsyncLatencyLogger::GetTimeStamp
 void AsyncLatencyLogger::Log(LatencyLogIndex aIndex, uint64_t aID, int64_t aValue)
 {
   TimeStamp null;
   Log(aIndex, aID, aValue, null);
 }
 
 void AsyncLatencyLogger::Log(LatencyLogIndex aIndex, uint64_t aID, int64_t aValue, TimeStamp &aTime)
 {
-  if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
     nsCOMPtr<nsIRunnable> event = new LogEvent(aIndex, aID, aValue, aTime);
     if (mThread) {
       mThread->Dispatch(event, NS_DISPATCH_NORMAL);
     }
   }
 }
--- a/dom/media/directshow/SampleSink.cpp
+++ b/dom/media/directshow/SampleSink.cpp
@@ -60,17 +60,17 @@ SampleSink::Receive(IMediaSample* aSampl
     }
     if (mAtEOS) {
       return E_UNEXPECTED;
     }
     // Wait until the consumer thread consumes the sample.
     mon.Wait();
   }
 
-  if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
     REFERENCE_TIME start = 0, end = 0;
     HRESULT hr = aSample->GetMediaTime(&start, &end);
     LOG("SampleSink::Receive() [%4.2lf-%4.2lf]",
         (double)RefTimeToUsecs(start) / USECS_PER_S,
         (double)RefTimeToUsecs(end) / USECS_PER_S);
   }
 
   mSample = aSample;
@@ -97,17 +97,17 @@ SampleSink::Extract(RefPtr<IMediaSample>
       // before reporting EOS.
       return E_UNEXPECTED;
     }
     // Wait until the producer thread gives us a sample.
     mon.Wait();
   }
   aOutSample = mSample;
 
-  if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) {
     int64_t start = 0, end = 0;
     mSample->GetMediaTime(&start, &end);
     LOG("SampleSink::Extract() [%4.2lf-%4.2lf]",
         (double)RefTimeToUsecs(start) / USECS_PER_S,
         (double)RefTimeToUsecs(end) / USECS_PER_S);
   }
 
   mSample = nullptr;
--- a/dom/media/eme/EMEUtils.h
+++ b/dom/media/eme/EMEUtils.h
@@ -10,17 +10,17 @@
 #include "mozilla/Logging.h"
 #include "nsString.h"
 
 namespace mozilla {
 
 #ifndef EME_LOG
   PRLogModuleInfo* GetEMELog();
   #define EME_LOG(...) MOZ_LOG(GetEMELog(), PR_LOG_DEBUG, (__VA_ARGS__))
-  #define EME_LOG_ENABLED() PR_LOG_TEST(GetEMELog(), PR_LOG_DEBUG)
+  #define EME_LOG_ENABLED() MOZ_LOG_TEST(GetEMELog(), PR_LOG_DEBUG)
 #endif
 
 #ifndef EME_VERBOSE_LOG
   PRLogModuleInfo* GetEMEVerboseLog();
   #define EME_VERBOSE_LOG(...) MOZ_LOG(GetEMEVerboseLog(), PR_LOG_DEBUG, (__VA_ARGS__))
 #else
   #ifndef EME_LOG
     #define EME_LOG(...)
--- a/dom/media/systemservices/LoadManager.cpp
+++ b/dom/media/systemservices/LoadManager.cpp
@@ -17,17 +17,17 @@
 #include "nsNetUtil.h"
 #include "nsIObserverService.h"
 
 // NSPR_LOG_MODULES=LoadManager:5
 PRLogModuleInfo *gLoadManagerLog = nullptr;
 #undef LOG
 #undef LOG_ENABLED
 #define LOG(args) MOZ_LOG(gLoadManagerLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gLoadManagerLog, 5)
+#define LOG_ENABLED() MOZ_LOG_TEST(gLoadManagerLog, 5)
 
 namespace mozilla {
 
 /* static */ StaticRefPtr<LoadManagerSingleton> LoadManagerSingleton::sSingleton;
 
 NS_IMPL_ISUPPORTS(LoadManagerSingleton, nsIObserver)
 
 
--- a/dom/media/systemservices/LoadMonitor.cpp
+++ b/dom/media/systemservices/LoadMonitor.cpp
@@ -52,18 +52,18 @@
 #include <tchar.h>
 #pragma comment(lib, "pdh.lib")
 #endif
 
 // NSPR_LOG_MODULES=LoadManager:5
 #undef LOG
 #undef LOG_ENABLED
 #define LOG(args) MOZ_LOG(gLoadManagerLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gLoadManagerLog, 4)
-#define LOG_MANY_ENABLED() PR_LOG_TEST(gLoadManagerLog, 5)
+#define LOG_ENABLED() MOZ_LOG_TEST(gLoadManagerLog, 4)
+#define LOG_MANY_ENABLED() MOZ_LOG_TEST(gLoadManagerLog, 5)
 
 namespace mozilla {
 
 NS_IMPL_ISUPPORTS(LoadMonitor, nsIObserver)
 
 LoadMonitor::LoadMonitor(int aLoadUpdateInterval)
   : mLoadUpdateInterval(aLoadUpdateInterval),
     mLock("LoadMonitor.mLock"),
--- a/dom/media/systemservices/OpenSLESProvider.cpp
+++ b/dom/media/systemservices/OpenSLESProvider.cpp
@@ -11,17 +11,17 @@
 #include <SLES/OpenSLES_Android.h>
 #include <SLES/OpenSLES_AndroidConfiguration.h>
 
 // NSPR_LOG_MODULES=OpenSLESProvider:5
 #undef LOG
 #undef LOG_ENABLED
 PRLogModuleInfo *gOpenSLESProviderLog;
 #define LOG(args) MOZ_LOG(gOpenSLESProviderLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gOpenSLESProviderLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gOpenSLESProviderLog, PR_LOG_DEBUG)
 
 namespace mozilla {
 
 OpenSLESProvider::OpenSLESProvider()
   : mLock("OpenSLESProvider.mLock"),
     mSLEngine(nullptr),
     mSLEngineUsers(0),
     mIsRealized(false),
--- a/dom/media/webm/WebMReader.cpp
+++ b/dom/media/webm/WebMReader.cpp
@@ -99,17 +99,17 @@ static int64_t webm_tell(void *aUserData
   NS_ASSERTION(resource, "Decoder has no media resource");
   return resource->Tell();
 }
 
 static void webm_log(nestegg * context,
                      unsigned int severity,
                      char const * format, ...)
 {
-  if (!PR_LOG_TEST(gNesteggLog, PR_LOG_DEBUG)) {
+  if (!MOZ_LOG_TEST(gNesteggLog, PR_LOG_DEBUG)) {
     return;
   }
 
   va_list args;
   char msg[256];
   const char * sevStr;
 
   switch(severity) {
--- a/dom/media/webrtc/MediaEngineCameraVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineCameraVideoSource.cpp
@@ -213,17 +213,17 @@ MediaEngineCameraVideoSource::LogConstra
        c.mFrameRate.mIdeal.WasPassed()? c.mFrameRate.mIdeal.Value() : 0));
 }
 
 bool
 MediaEngineCameraVideoSource::ChooseCapability(
     const dom::MediaTrackConstraints &aConstraints,
     const MediaEnginePrefs &aPrefs)
 {
-  if (PR_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) {
     LOG(("ChooseCapability: prefs: %dx%d @%d-%dfps",
          aPrefs.GetWidth(), aPrefs.GetHeight(),
          aPrefs.mFPS, aPrefs.mMinFPS));
     LogConstraints(aConstraints, false);
     if (aConstraints.mAdvanced.WasPassed()) {
       LOG(("Advanced array[%u]:", aConstraints.mAdvanced.Value().Length()));
       for (auto& advanced : aConstraints.mAdvanced.Value()) {
         LogConstraints(advanced, true);
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -270,17 +270,17 @@ MediaEngineWebRTCAudioSource::Allocate(c
         return NS_ERROR_FAILURE;
       }
       mState = kAllocated;
       LOG(("Audio device %d allocated", mCapIndex));
     } else {
       LOG(("Audio device is not initalized"));
       return NS_ERROR_FAILURE;
     }
-  } else if (PR_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) {
+  } else if (MOZ_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) {
     MonitorAutoLock lock(mMonitor);
     if (mSources.IsEmpty()) {
       LOG(("Audio device %d reallocated", mCapIndex));
     } else {
       LOG(("Audio device %d allocated shared", mCapIndex));
     }
   }
   return NS_OK;
--- a/dom/media/webrtc/MediaEngineWebRTCVideo.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCVideo.cpp
@@ -222,17 +222,17 @@ MediaEngineWebRTCVideoSource::Allocate(c
       return NS_ERROR_UNEXPECTED;
     }
     if (mViECapture->AllocateCaptureDevice(NS_ConvertUTF16toUTF8(mUniqueId).get(),
                                            kMaxUniqueIdLength, mCaptureIndex)) {
       return NS_ERROR_FAILURE;
     }
     mState = kAllocated;
     LOG(("Video device %d allocated", mCaptureIndex));
-  } else if (PR_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) {
+  } else if (MOZ_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) {
     MonitorAutoLock lock(mMonitor);
     if (mSources.IsEmpty()) {
       LOG(("Video device %d reallocated", mCaptureIndex));
     } else {
       LOG(("Video device %d allocated shared", mCaptureIndex));
     }
   }
 
--- a/dom/network/UDPSocket.h
+++ b/dom/network/UDPSocket.h
@@ -20,17 +20,17 @@ struct JSContext;
 
 #if defined(PR_LOGGING)
 //
 // set NSPR_LOG_MODULES=UDPSocket:5
 //
 extern PRLogModuleInfo *gUDPSocketLog;
 #endif
 #define UDPSOCKET_LOG(args)     PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args)
-#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
+#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
 
 namespace mozilla {
 namespace dom {
 
 struct UDPOptions;
 class StringOrBlobOrArrayBufferOrArrayBufferView;
 
 class UDPSocket final : public DOMEventTargetHelper
--- a/dom/network/UDPSocketChild.cpp
+++ b/dom/network/UDPSocketChild.cpp
@@ -19,17 +19,17 @@ using mozilla::net::gNeckoChild;
 
 #if defined(PR_LOGGING)
 //
 // set NSPR_LOG_MODULES=UDPSocket:5
 //
 extern PRLogModuleInfo *gUDPSocketLog;
 #endif
 #define UDPSOCKET_LOG(args)     PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args)
-#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
+#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS(UDPSocketChildBase, nsIUDPSocketChild)
 
 UDPSocketChildBase::UDPSocketChildBase()
 : mIPCOpen(false)
--- a/dom/network/UDPSocketParent.cpp
+++ b/dom/network/UDPSocketParent.cpp
@@ -24,17 +24,17 @@
 
 #if defined(PR_LOGGING)
 //
 // set NSPR_LOG_MODULES=UDPSocket:5
 //
 extern PRLogModuleInfo *gUDPSocketLog;
 #endif
 #define UDPSOCKET_LOG(args)     PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args)
-#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
+#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS(UDPSocketParent, nsIUDPSocketListener)
 
 UDPSocketParent::UDPSocketParent(PBackgroundParent* aManager)
   : mBackgroundManager(aManager)
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -48,17 +48,17 @@ GetCspContextLog()
 {
   static PRLogModuleInfo *gCspContextPRLog;
   if (!gCspContextPRLog)
     gCspContextPRLog = PR_NewLogModule("CSPContext");
   return gCspContextPRLog;
 }
 
 #define CSPCONTEXTLOG(args) MOZ_LOG(GetCspContextLog(), PR_LOG_DEBUG, args)
-#define CSPCONTEXTLOGENABLED() PR_LOG_TEST(GetCspContextLog(), PR_LOG_DEBUG)
+#define CSPCONTEXTLOGENABLED() MOZ_LOG_TEST(GetCspContextLog(), PR_LOG_DEBUG)
 
 static const uint32_t CSP_CACHE_URI_CUTOFF_SIZE = 512;
 
 /**
  * Creates a key for use in the ShouldLoad cache.
  * Looks like: <uri>!<nsIContentPolicy::LOAD_TYPE>
  */
 nsresult
--- a/dom/security/nsCSPParser.cpp
+++ b/dom/security/nsCSPParser.cpp
@@ -24,17 +24,17 @@ GetCspParserLog()
 {
   static PRLogModuleInfo* gCspParserPRLog;
   if (!gCspParserPRLog)
     gCspParserPRLog = PR_NewLogModule("CSPParser");
   return gCspParserPRLog;
 }
 
 #define CSPPARSERLOG(args) MOZ_LOG(GetCspParserLog(), PR_LOG_DEBUG, args)
-#define CSPPARSERLOGENABLED() PR_LOG_TEST(GetCspParserLog(), PR_LOG_DEBUG)
+#define CSPPARSERLOGENABLED() MOZ_LOG_TEST(GetCspParserLog(), PR_LOG_DEBUG)
 
 static const char16_t COLON        = ':';
 static const char16_t SEMICOLON    = ';';
 static const char16_t SLASH        = '/';
 static const char16_t PLUS         = '+';
 static const char16_t DASH         = '-';
 static const char16_t DOT          = '.';
 static const char16_t UNDERLINE    = '_';
--- a/dom/security/nsCSPService.cpp
+++ b/dom/security/nsCSPService.cpp
@@ -104,17 +104,17 @@ CSPService::ShouldLoad(uint32_t aContent
                        nsISupports *aExtra,
                        nsIPrincipal *aRequestPrincipal,
                        int16_t *aDecision)
 {
   if (!aContentLocation) {
     return NS_ERROR_FAILURE;
   }
 
-  if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
     nsAutoCString location;
     aContentLocation->GetSpec(location);
     MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
            ("CSPService::ShouldLoad called for %s", location.get()));
   }
 
   // default decision, CSP can revise it if there's a policy to enforce
   *aDecision = nsIContentPolicy::ACCEPT;
@@ -199,17 +199,17 @@ CSPService::ShouldLoad(uint32_t aContent
   nsCOMPtr<nsINode> node(do_QueryInterface(aRequestContext));
   nsCOMPtr<nsIPrincipal> principal;
   nsCOMPtr<nsIContentSecurityPolicy> csp;
   if (node) {
     principal = node->NodePrincipal();
     principal->GetCsp(getter_AddRefs(csp));
 
     if (csp) {
-      if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
+      if (MOZ_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
         uint32_t numPolicies = 0;
         nsresult rv = csp->GetPolicyCount(&numPolicies);
         if (NS_SUCCEEDED(rv)) {
           for (uint32_t i=0; i<numPolicies; i++) {
             nsAutoString policy;
             csp->GetPolicy(i, policy);
             MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
                    ("Document has CSP[%d]: %s", i,
@@ -223,17 +223,17 @@ CSPService::ShouldLoad(uint32_t aContent
                       aContentLocation,
                       aRequestOrigin,
                       aRequestContext,
                       aMimeTypeGuess,
                       nullptr,
                       aDecision);
     }
   }
-  else if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
+  else if (MOZ_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
     nsAutoCString uriSpec;
     aContentLocation->GetSpec(uriSpec);
     MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
            ("COULD NOT get nsINode for location: %s", uriSpec.get()));
   }
 
   return NS_OK;
 }
@@ -311,17 +311,17 @@ CSPService::AsyncOnChannelRedirect(nsICh
   csp->ShouldLoad(policyType,     // load type per nsIContentPolicy (uint32_t)
                   newUri,         // nsIURI
                   nullptr,        // nsIURI
                   nullptr,        // nsISupports
                   EmptyCString(), // ACString - MIME guess
                   originalUri,    // aMimeTypeGuess
                   &aDecision);
 
-  if (newUri && PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
+  if (newUri && MOZ_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
     nsAutoCString newUriSpec("None");
     newUri->GetSpec(newUriSpec);
     MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
            ("CSPService::AsyncOnChannelRedirect called for %s",
             newUriSpec.get()));
   }
   if (aDecision == 1) {
     MOZ_LOG(gCspPRLog, PR_LOG_DEBUG,
--- a/dom/security/nsCSPUtils.cpp
+++ b/dom/security/nsCSPUtils.cpp
@@ -19,17 +19,17 @@ GetCspUtilsLog()
 {
   static PRLogModuleInfo* gCspUtilsPRLog;
   if (!gCspUtilsPRLog)
     gCspUtilsPRLog = PR_NewLogModule("CSPUtils");
   return gCspUtilsPRLog;
 }
 
 #define CSPUTILSLOG(args) MOZ_LOG(GetCspUtilsLog(), PR_LOG_DEBUG, args)
-#define CSPUTILSLOGENABLED() PR_LOG_TEST(GetCspUtilsLog(), PR_LOG_DEBUG)
+#define CSPUTILSLOGENABLED() MOZ_LOG_TEST(GetCspUtilsLog(), PR_LOG_DEBUG)
 
 void
 CSP_GetLocalizedStr(const char16_t* aName,
                     const char16_t** aParams,
                     uint32_t aLength,
                     char16_t** outResult)
 {
   nsCOMPtr<nsIStringBundle> keyStringBundle;
--- a/dom/xslt/xslt/txStylesheet.cpp
+++ b/dom/xslt/xslt/txStylesheet.cpp
@@ -152,17 +152,17 @@ txStylesheet::findTemplate(const txXPath
 #if defined(TX_TO_STRING)
                     match = templ.mMatch;
 #endif
                 }
             }
         }
     }
 
-    if (PR_LOG_TEST(txLog::xslt, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(txLog::xslt, PR_LOG_DEBUG)) {
       nsAutoString mode, nodeName;
       if (aMode.mLocalName) {
           aMode.mLocalName->ToString(mode);
       }
       txXPathNodeUtils::getNodeName(aNode, nodeName);
       if (matchTemplate) {
           nsAutoString matchAttr;
 #ifdef TX_TO_STRING
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -370,17 +370,17 @@ XULDocument::SetContentType(const nsAStr
 // being cached or not.
 nsresult
 XULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
                                nsILoadGroup* aLoadGroup,
                                nsISupports* aContainer,
                                nsIStreamListener **aDocListener,
                                bool aReset, nsIContentSink* aSink)
 {
-    if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_WARNING)) {
 
         nsCOMPtr<nsIURI> uri;
         nsresult rv = aChannel->GetOriginalURI(getter_AddRefs(uri));
         if (NS_SUCCEEDED(rv)) {
             nsAutoCString urlspec;
             rv = uri->GetSpec(urlspec);
             if (NS_SUCCEEDED(rv)) {
                 MOZ_LOG(gXULLog, PR_LOG_WARNING,
@@ -554,17 +554,17 @@ XULDocument::EndLoad()
             // documents that raced to load the prototype, and awaited
             // its load completion via proto->AwaitLoadDone().
             rv = mCurrentPrototype->NotifyLoadDone();
             if (NS_FAILED(rv)) return;
         }
     }
 
     OnPrototypeLoadDone(true);
-    if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_WARNING)) {
         nsAutoCString urlspec;
         rv = uri->GetSpec(urlspec);
         if (NS_SUCCEEDED(rv)) {
             MOZ_LOG(gXULLog, PR_LOG_WARNING,
                    ("xul: Finished loading document '%s'", urlspec.get()));
         }
     }
 }
@@ -2266,17 +2266,17 @@ XULDocument::PrepareToWalk()
     // elements aren't yanked from beneath us.
     mPrototypes.AppendElement(mCurrentPrototype);
 
     // Get the prototype's root element and initialize the context
     // stack for the prototype walk.
     nsXULPrototypeElement* proto = mCurrentPrototype->GetRootElement();
 
     if (! proto) {
-        if (PR_LOG_TEST(gXULLog, PR_LOG_ERROR)) {
+        if (MOZ_LOG_TEST(gXULLog, PR_LOG_ERROR)) {
             nsCOMPtr<nsIURI> url = mCurrentPrototype->GetURI();
 
             nsAutoCString urlspec;
             rv = url->GetSpec(urlspec);
             if (NS_FAILED(rv)) return rv;
 
             MOZ_LOG(gXULLog, PR_LOG_ERROR,
                    ("xul: error parsing '%s'", urlspec.get()));
@@ -2537,17 +2537,17 @@ XULDocument::LoadOverlayInternal(nsIURI*
                                  bool* aShouldReturn,
                                  bool* aFailureFromContent)
 {
     nsresult rv;
 
     *aShouldReturn = false;
     *aFailureFromContent = false;
 
-    if (PR_LOG_TEST(gXULLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_DEBUG)) {
         nsAutoCString urlspec;
         aURI->GetSpec(urlspec);
         nsAutoCString parentDoc;
         nsCOMPtr<nsIURI> uri;
         nsresult rv = mChannel->GetOriginalURI(getter_AddRefs(uri));
         if (NS_SUCCEEDED(rv))
             rv = uri->GetSpec(parentDoc);
         if (!(parentDoc.get()))
@@ -3573,17 +3573,17 @@ XULDocument::CreateElementFromPrototype(
     // Create a content model element from a prototype element.
     NS_PRECONDITION(aPrototype != nullptr, "null ptr");
     if (! aPrototype)
         return NS_ERROR_NULL_POINTER;
 
     *aResult = nullptr;
     nsresult rv = NS_OK;
 
-    if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
         MOZ_LOG(gXULLog, PR_LOG_NOTICE,
                ("xul: creating <%s> from prototype",
                 NS_ConvertUTF16toUTF8(aPrototype->mNodeInfo->QualifiedName()).get()));
     }
 
     nsRefPtr<Element> result;
 
     if (aPrototype->mNodeInfo->NamespaceEquals(kNameSpaceID_XUL)) {
@@ -3843,17 +3843,17 @@ XULDocument::OverlayForwardReference::Re
     if (!notify && target->GetUncomposedDoc() == mDocument) {
         // Add child and any descendants to the element map
         // XXX this is bogus, the content in 'target' might already be
         // in the document
         rv = mDocument->AddSubtreeToDocument(target);
         if (NS_FAILED(rv)) return eResolve_Error;
     }
 
-    if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
         nsAutoCString idC;
         idC.AssignWithConversion(id);
         MOZ_LOG(gXULLog, PR_LOG_NOTICE,
                ("xul: overlay resolved '%s'",
                 idC.get()));
     }
 
     mResolved = true;
@@ -4012,17 +4012,17 @@ XULDocument::OverlayForwardReference::Me
 
     return NS_OK;
 }
 
 
 
 XULDocument::OverlayForwardReference::~OverlayForwardReference()
 {
-    if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) {
         nsAutoString id;
         mOverlay->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id);
 
         nsAutoCString idC;
         idC.AssignWithConversion(id);
 
         nsIURI *protoURI = mDocument->mCurrentPrototype->GetURI();
         nsAutoCString urlspec;
@@ -4055,17 +4055,17 @@ XULDocument::BroadcasterHookup::Resolve(
     if (NS_FAILED(rv)) return eResolve_Error;
 
     return mResolved ? eResolve_Succeeded : eResolve_Later;
 }
 
 
 XULDocument::BroadcasterHookup::~BroadcasterHookup()
 {
-    if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) {
         // Tell the world we failed
 
         nsAutoString broadcasterID;
         nsAutoString attribute;
 
         if (mObservesElement->IsXULElement(nsGkAtoms::observes)) {
             mObservesElement->GetAttr(kNameSpaceID_None, nsGkAtoms::element, broadcasterID);
             mObservesElement->GetAttr(kNameSpaceID_None, nsGkAtoms::attribute, attribute);
@@ -4274,17 +4274,17 @@ XULDocument::CheckBroadcasterHookup(Elem
     NS_ENSURE_ARG(broadcaster && listener);
     ErrorResult domRv;
     AddBroadcastListenerFor(*broadcaster, *listener, attribute, domRv);
     if (domRv.Failed()) {
         return domRv.StealNSResult();
     }
 
     // Tell the world we succeeded
-    if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
         nsCOMPtr<nsIContent> content =
             do_QueryInterface(listener);
 
         NS_ASSERTION(content != nullptr, "not an nsIContent");
         if (! content)
             return rv;
 
         nsAutoCString attributeC,broadcasteridC;
--- a/dom/xul/nsXULCommandDispatcher.cpp
+++ b/dom/xul/nsXULCommandDispatcher.cpp
@@ -263,17 +263,17 @@ nsXULCommandDispatcher::AddCommandUpdate
 
   Updater* updater = mUpdaters;
   Updater** link = &mUpdaters;
 
   while (updater) {
     if (updater->mElement == aElement) {
 
 #ifdef DEBUG
-      if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
+      if (MOZ_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
         nsAutoCString eventsC, targetsC, aeventsC, atargetsC; 
         eventsC.AssignWithConversion(updater->mEvents);
         targetsC.AssignWithConversion(updater->mTargets);
         CopyUTF16toUTF8(aEvents, aeventsC);
         CopyUTF16toUTF8(aTargets, atargetsC);
         MOZ_LOG(gCommandLog, PR_LOG_NOTICE,
                ("xulcmd[%p] replace %p(events=%s targets=%s) with (events=%s targets=%s)",
                 this, aElement,
@@ -291,17 +291,17 @@ nsXULCommandDispatcher::AddCommandUpdate
       updater->mTargets = aTargets;
       return NS_OK;
     }
 
     link = &(updater->mNext);
     updater = updater->mNext;
   }
 #ifdef DEBUG
-  if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
+  if (MOZ_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
     nsAutoCString aeventsC, atargetsC; 
     CopyUTF16toUTF8(aEvents, aeventsC);
     CopyUTF16toUTF8(aTargets, atargetsC);
 
     MOZ_LOG(gCommandLog, PR_LOG_NOTICE,
            ("xulcmd[%p] add     %p(events=%s targets=%s)",
             this, aElement,
             aeventsC.get(),
@@ -326,17 +326,17 @@ nsXULCommandDispatcher::RemoveCommandUpd
     return NS_ERROR_NULL_POINTER;
 
   Updater* updater = mUpdaters;
   Updater** link = &mUpdaters;
 
   while (updater) {
     if (updater->mElement == aElement) {
 #ifdef DEBUG
-      if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
+      if (MOZ_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
         nsAutoCString eventsC, targetsC; 
         eventsC.AssignWithConversion(updater->mEvents);
         targetsC.AssignWithConversion(updater->mTargets);
         MOZ_LOG(gCommandLog, PR_LOG_NOTICE,
                ("xulcmd[%p] remove  %p(events=%s targets=%s)",
                 this, aElement,
                 eventsC.get(),
                 targetsC.get()));
@@ -386,17 +386,17 @@ nsXULCommandDispatcher::UpdateCommands(c
 
     updaters.AppendObject(content);
   }
 
   for (int32_t u = 0; u < updaters.Count(); u++) {
     nsIContent* content = updaters[u];
 
 #ifdef DEBUG
-    if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) {
       nsAutoCString aeventnameC; 
       CopyUTF16toUTF8(aEventName, aeventnameC);
       MOZ_LOG(gCommandLog, PR_LOG_NOTICE,
              ("xulcmd[%p] update %p event=%s",
               this, content,
               aeventnameC.get()));
     }
 #endif
--- a/dom/xul/nsXULContentSink.cpp
+++ b/dom/xul/nsXULContentSink.cpp
@@ -734,17 +734,17 @@ XULContentSinkImpl::OpenRoot(const char1
         return NS_ERROR_UNEXPECTED;
     }
 
     // Create the element
     nsXULPrototypeElement* element;
     rv = CreateElement(aNodeInfo, &element);
 
     if (NS_FAILED(rv)) {
-        if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
+        if (MOZ_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
             nsAutoString anodeC;
             aNodeInfo->GetName(anodeC);
             MOZ_LOG(gContentSinkLog, PR_LOG_ERROR,
                    ("xul: unable to create element '%s' at line %d",
                     NS_ConvertUTF16toUTF8(anodeC).get(),
                     -1)); // XXX pass in line number
         }
 
@@ -775,17 +775,17 @@ XULContentSinkImpl::OpenTag(const char16
 {
     nsresult rv;
 
     // Create the element
     nsXULPrototypeElement* element;
     rv = CreateElement(aNodeInfo, &element);
 
     if (NS_FAILED(rv)) {
-        if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
+        if (MOZ_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
             nsAutoString anodeC;
             aNodeInfo->GetName(anodeC);
             MOZ_LOG(gContentSinkLog, PR_LOG_ERROR,
                    ("xul: unable to create element '%s' at line %d",
                     NS_ConvertUTF16toUTF8(anodeC).get(),
                     aLineNumber));
         }
 
@@ -972,17 +972,17 @@ XULContentSinkImpl::AddAttributes(const 
   for (i = 0; i < aAttrLen; ++i) {
       rv = NormalizeAttributeString(aAttributes[i * 2], attrs[i].mName);
       NS_ENSURE_SUCCESS(rv, rv);
 
       rv = aElement->SetAttrAt(i, nsDependentString(aAttributes[i * 2 + 1]),
                                mDocumentURL);
       NS_ENSURE_SUCCESS(rv, rv);
 
-      if (PR_LOG_TEST(gContentSinkLog, PR_LOG_DEBUG)) {
+      if (MOZ_LOG_TEST(gContentSinkLog, PR_LOG_DEBUG)) {
           nsAutoString extraWhiteSpace;
           int32_t cnt = mContextStack.Depth();
           while (--cnt >= 0)
               extraWhiteSpace.AppendLiteral("  ");
           nsAutoString qnameC,valueC;
           qnameC.Assign(aAttributes[0]);
           valueC.Assign(aAttributes[1]);
           MOZ_LOG(gContentSinkLog, PR_LOG_DEBUG,
--- a/dom/xul/templates/nsContentTestNode.cpp
+++ b/dom/xul/templates/nsContentTestNode.cpp
@@ -18,17 +18,17 @@ extern PRLogModuleInfo* gXULTemplateLog;
 nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
                                      nsIAtom* aRefVariable)
     : TestNode(nullptr),
       mProcessor(aProcessor),
       mDocument(nullptr),
       mRefVariable(aRefVariable),
       mTag(nullptr)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsAutoString tag(NS_LITERAL_STRING("(none)"));
         if (mTag)
             mTag->ToString(tag);
 
         nsAutoString refvar(NS_LITERAL_STRING("(none)"));
         if (aRefVariable)
             aRefVariable->ToString(refvar);
 
--- a/dom/xul/templates/nsRDFConInstanceTestNode.cpp
+++ b/dom/xul/templates/nsRDFConInstanceTestNode.cpp
@@ -31,17 +31,17 @@ nsRDFConInstanceTestNode::nsRDFConInstan
                                                    Test aContainer,
                                                    Test aEmpty)
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mContainerVariable(aContainerVariable),
       mContainer(aContainer),
       mEmpty(aEmpty)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsAutoCString props;
 
         nsResourceSet& containmentProps = aProcessor->ContainmentProperties();
         nsResourceSet::ConstIterator last = containmentProps.Last();
         nsResourceSet::ConstIterator first = containmentProps.First();
         nsResourceSet::ConstIterator iter;
 
         for (iter = first; iter != last; ++iter) {
@@ -95,17 +95,17 @@ nsRDFConInstanceTestNode::FilterInstanti
         }
 
         nsCOMPtr<nsIRDFResource> valueres = do_QueryInterface(value);
         if (! valueres) {
             aInstantiations.Erase(inst--);
             continue;
         }
 
-        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             const char* container = "(unbound)";
             valueres->GetValueConst(&container);
 
             MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("nsRDFConInstanceTestNode[%p]::FilterInstantiations() container=[%s]",
                     this, container));
         }
 
@@ -240,17 +240,17 @@ nsRDFConInstanceTestNode::CanPropagate(n
     // We can certainly propagate ordinal properties
     rv = rdfc->IsOrdinalProperty(aProperty, &canpropagate);
     if (NS_FAILED(rv)) return false;
 
     if (! canpropagate) {
         canpropagate = mProcessor->ContainmentProperties().Contains(aProperty);
     }
 
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source;
         aSource->GetValueConst(&source);
 
         const char* property;
         aProperty->GetValueConst(&property);
 
         nsAutoString target;
         nsXULContentUtils::GetTextForNode(aTarget, target);
--- a/dom/xul/templates/nsRDFConMemberTestNode.cpp
+++ b/dom/xul/templates/nsRDFConMemberTestNode.cpp
@@ -19,17 +19,17 @@ nsRDFConMemberTestNode::nsRDFConMemberTe
                                                nsXULTemplateQueryProcessorRDF* aProcessor,
                                                nsIAtom *aContainerVariable,
                                                nsIAtom *aMemberVariable)
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mContainerVariable(aContainerVariable),
       mMemberVariable(aMemberVariable)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsAutoCString props;
 
         nsResourceSet& containmentProps = aProcessor->ContainmentProperties();
         nsResourceSet::ConstIterator last = containmentProps.Last();
         nsResourceSet::ConstIterator first = containmentProps.First();
         nsResourceSet::ConstIterator iter;
 
         for (iter = first; iter != last; ++iter) {
@@ -106,17 +106,17 @@ nsRDFConMemberTestNode::FilterInstantiat
             }
         }
 
         bool hasMemberBinding;
         nsCOMPtr<nsIRDFNode> memberValue;
         hasMemberBinding = inst->mAssignments.GetAssignmentFor(mMemberVariable,
                                                                getter_AddRefs(memberValue));
 
-        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             const char* container = "(unbound)";
             if (hasContainerBinding)
                 containerRes->GetValueConst(&container);
 
             nsAutoString member(NS_LITERAL_STRING("(unbound)"));
             if (hasMemberBinding)
                 nsXULContentUtils::GetTextForNode(memberValue, member);
 
@@ -210,17 +210,17 @@ nsRDFConMemberTestNode::FilterInstantiat
                 nsCOMPtr<nsISupports> isupports;
                 rv = elements->GetNext(getter_AddRefs(isupports));
                 if (NS_FAILED(rv)) return rv;
 
                 nsCOMPtr<nsIRDFNode> node = do_QueryInterface(isupports);
                 if (! node)
                     return NS_ERROR_UNEXPECTED;
 
-                if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+                if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                     nsAutoString member;
                     nsXULContentUtils::GetTextForNode(node, member);
 
                     MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                            ("    member => %s", NS_ConvertUTF16toUTF8(member).get()));
                 }
 
                 Instantiation newinst = *inst;
@@ -297,17 +297,17 @@ nsRDFConMemberTestNode::FilterInstantiat
                         nsCOMPtr<nsISupports> isupports;
                         rv = sources->GetNext(getter_AddRefs(isupports));
                         if (NS_FAILED(rv)) return rv;
 
                         nsCOMPtr<nsIRDFResource> source = do_QueryInterface(isupports);
                         if (! source)
                             return NS_ERROR_UNEXPECTED;
 
-                        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+                        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                             const char* container;
                             source->GetValueConst(&container);
 
                             MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                    ("    container => %s", container));
                         }
 
                         // Add a new instantiation
@@ -367,34 +367,34 @@ nsRDFConMemberTestNode::FilterInstantiat
 
                     if (hasContainerBinding) {
                         variable = mMemberVariable;
 
                         value = do_QueryInterface(isupports);
                         NS_ASSERTION(value != nullptr, "member is not an nsIRDFNode");
                         if (! value) continue;
 
-                        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+                        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                             nsAutoString s;
                             nsXULContentUtils::GetTextForNode(value, s);
 
                             MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                    ("    member => %s", NS_ConvertUTF16toUTF8(s).get()));
                         }
                     }
                     else {
                         variable = mContainerVariable;
 
                         valueRes = do_QueryInterface(isupports);
                         NS_ASSERTION(valueRes != nullptr, "container is not an nsIRDFResource");
                         if (! valueRes) continue;
 
                         value = valueRes;
 
-                        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+                        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                             const char* s;
                             valueRes->GetValueConst(&s);
 
                             MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                    ("    container => %s", s));
                         }
                     }
 
@@ -461,17 +461,17 @@ nsRDFConMemberTestNode::CanPropagate(nsI
     // We can certainly propagate ordinal properties
     rv = rdfc->IsOrdinalProperty(aProperty, &canpropagate);
     if (NS_FAILED(rv)) return false;
 
     if (! canpropagate) {
         canpropagate = mProcessor->ContainmentProperties().Contains(aProperty);
     }
 
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source;
         aSource->GetValueConst(&source);
 
         const char* property;
         aProperty->GetValueConst(&property);
 
         nsAutoString target;
         nsXULContentUtils::GetTextForNode(aTarget, target);
--- a/dom/xul/templates/nsRDFPropertyTestNode.cpp
+++ b/dom/xul/templates/nsRDFPropertyTestNode.cpp
@@ -19,17 +19,17 @@ nsRDFPropertyTestNode::nsRDFPropertyTest
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mSourceVariable(aSourceVariable),
       mSource(nullptr),
       mProperty(aProperty),
       mTargetVariable(aTargetVariable),
       mTarget(nullptr)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* prop = "(null)";
         if (aProperty)
             aProperty->GetValueConst(&prop);
 
         nsAutoString svar(NS_LITERAL_STRING("(none)"));
         if (mSourceVariable)
             mSourceVariable->ToString(svar);
 
@@ -52,17 +52,17 @@ nsRDFPropertyTestNode::nsRDFPropertyTest
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mSourceVariable(0),
       mSource(aSource),
       mProperty(aProperty),
       mTargetVariable(aTargetVariable),
       mTarget(nullptr)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source = "(null)";
         if (aSource)
             aSource->GetValueConst(&source);
 
         const char* prop = "(null)";
         if (aProperty)
             aProperty->GetValueConst(&prop);
 
@@ -85,17 +85,17 @@ nsRDFPropertyTestNode::nsRDFPropertyTest
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mSourceVariable(aSourceVariable),
       mSource(nullptr),
       mProperty(aProperty),
       mTargetVariable(0),
       mTarget(aTarget)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsAutoString svar(NS_LITERAL_STRING("(none)"));
         if (mSourceVariable)
             mSourceVariable->ToString(svar);
 
         const char* prop = "(null)";
         if (aProperty)
             aProperty->GetValueConst(&prop);
 
@@ -143,17 +143,17 @@ nsRDFPropertyTestNode::FilterInstantiati
             hasTargetBinding = true;
             targetValue = mTarget;
         }
         else {
             hasTargetBinding = inst->mAssignments.GetAssignmentFor(mTargetVariable,
                                                                    getter_AddRefs(targetValue));
         }
 
-        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             const char* source = "(unbound)";
             if (hasSourceBinding)
                 sourceRes->GetValueConst(&source);
 
             nsAutoString target(NS_LITERAL_STRING("(unbound)"));
             if (hasTargetBinding)
                 nsXULContentUtils::GetTextForNode(targetValue, target);
 
@@ -224,17 +224,17 @@ nsRDFPropertyTestNode::FilterInstantiati
                 nsCOMPtr<nsIRDFNode> value;
 
                 if (hasSourceBinding) {
                     variable = mTargetVariable;
 
                     value = do_QueryInterface(isupports);
                     NS_ASSERTION(value != nullptr, "target is not an nsIRDFNode");
 
-                    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+                    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                         nsAutoString s(NS_LITERAL_STRING("(none found)"));
                         if (value)
                             nsXULContentUtils::GetTextForNode(value, s);
 
                         MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                ("    target => %s", NS_ConvertUTF16toUTF8(s).get()));
                     }
 
@@ -243,17 +243,17 @@ nsRDFPropertyTestNode::FilterInstantiati
                     targetValue = value;
                 }
                 else {
                     variable = mSourceVariable;
 
                     nsCOMPtr<nsIRDFResource> source = do_QueryInterface(isupports);
                     NS_ASSERTION(source != nullptr, "source is not an nsIRDFResource");
 
-                    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+                    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                         const char* s = "(none found)";
                         if (source)
                             source->GetValueConst(&s);
 
                         MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                ("    source => %s", s));
                     }
 
@@ -316,17 +316,17 @@ nsRDFPropertyTestNode::CanPropagate(nsIR
             aInitialBindings.AddAssignment(mSourceVariable, aSource);
 
         if (mTargetVariable)
             aInitialBindings.AddAssignment(mTargetVariable, aTarget);
 
         result = true;
     }
 
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source;
         aSource->GetValueConst(&source);
 
         const char* property;
         aProperty->GetValueConst(&property);
 
         nsAutoString target;
         nsXULContentUtils::GetTextForNode(aTarget, target);
@@ -341,17 +341,17 @@ nsRDFPropertyTestNode::CanPropagate(nsIR
 }
 
 void
 nsRDFPropertyTestNode::Retract(nsIRDFResource* aSource,
                                nsIRDFResource* aProperty,
                                nsIRDFNode* aTarget) const
 {
     if (aProperty == mProperty.get()) {
-        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             const char* source;
             aSource->GetValueConst(&source);
 
             const char* property;
             aProperty->GetValueConst(&property);
 
             nsAutoString target;
             nsXULContentUtils::GetTextForNode(aTarget, target);
--- a/dom/xul/templates/nsXULContentBuilder.cpp
+++ b/dom/xul/templates/nsXULContentBuilder.cpp
@@ -441,17 +441,17 @@ nsXULContentBuilder::BuildContentFromTem
     // If |aNotify| is "false", then |aContainer| and
     // |aNewIndexInContainer| are used to determine where in the
     // content model new content is constructed. This allows a single
     // notification to be propagated to document observers.
     //
 
     nsresult rv;
 
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("nsXULContentBuilder::BuildContentFromTemplate (is unique: %d)",
                aIsUnique));
 
         nsAutoString id;
         aChild->GetId(id);
 
         MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
@@ -518,17 +518,17 @@ nsXULContentBuilder::BuildContentFromTem
             isGenerationElement = true;
             isUnique = false;
         }
 
         MOZ_ASSERT_IF(isGenerationElement, tmplKid->IsElement());
 
         nsIAtom *tag = tmplKid->NodeInfo()->NameAtom();
 
-        if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("xultemplate[%p]     building %s %s %s",
                     this, nsAtomCString(tag).get(),
                     (isGenerationElement ? "[resource]" : ""),
                     (isUnique ? "[unique]" : "")));
         }
 
         // Set to true if the child we're trying to create now
@@ -1068,17 +1068,17 @@ nsXULContentBuilder::CreateContainerCont
 nsresult
 nsXULContentBuilder::CreateContainerContentsForQuerySet(nsIContent* aElement,
                                                         nsIXULTemplateResult* aResult,
                                                         bool aNotify,
                                                         nsTemplateQuerySet* aQuerySet,
                                                         nsIContent** aContainer,
                                                         int32_t* aNewIndexInContainer)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsAutoString id;
         aResult->GetId(id);
         MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("nsXULContentBuilder::CreateContainerContentsForQuerySet start for ref %s\n",
                NS_ConvertUTF16toUTF8(id).get()));
     }
 
     if (! mQueryProcessor)
--- a/dom/xul/templates/nsXULTemplateBuilder.cpp
+++ b/dom/xul/templates/nsXULTemplateBuilder.cpp
@@ -1706,17 +1706,17 @@ nsXULTemplateBuilder::CompileQueries()
         mFlags |= eDontTestEmpty;
       else if (token.EqualsLiteral("dont-recurse"))
         mFlags |= eDontRecurse;
       else if (token.EqualsLiteral("logging"))
         mFlags |= eLoggingEnabled;
     }
 
     // always enable logging if the debug setting is used
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG))
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG))
         mFlags |= eLoggingEnabled;
 
     nsCOMPtr<nsIDOMNode> rootnode = do_QueryInterface(mRoot);
     nsresult rv =
         mQueryProcessor->InitializeForBuilding(mDataSource, this, rootnode);
     if (NS_FAILED(rv))
         return rv;
 
--- a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
+++ b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
@@ -478,17 +478,17 @@ nsXULTemplateQueryProcessorRDF::Generate
             TestNode* root = query->GetRoot();
 
             if (query->IsSimple() && mSimpleRuleMemberTest) {
                 // get the top node in the simple rule tree
                 root = mSimpleRuleMemberTest->GetParent();
                 mLastRef = aRef;
             }
 
-            if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+            if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                 nsAutoString id;
                 aRef->GetId(id);
 
                 nsAutoString rvar;
                 query->mRefVariable->ToString(rvar);
                 nsAutoString mvar;
                 query->mMemberVariable->ToString(mvar);
 
@@ -858,17 +858,17 @@ nsXULTemplateQueryProcessorRDF::Propagat
     // When a new assertion is added to the graph, determine any new matches
     // that must be added to the template builder. First, iterate through all
     // the RDF tests (<member> and <triple> tests), and find the topmost test
     // that would be affected by the new assertion.
     nsresult rv;
 
     ReteNodeSet livenodes;
 
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* sourceStr;
         aSource->GetValueConst(&sourceStr);
         const char* propertyStr;
         aProperty->GetValueConst(&propertyStr);
         nsAutoString targetStr;
         nsXULContentUtils::GetTextForNode(aTarget, targetStr);
 
         MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
@@ -945,17 +945,17 @@ nsXULTemplateQueryProcessorRDF::Propagat
 
 
 nsresult
 nsXULTemplateQueryProcessorRDF::Retract(nsIRDFResource* aSource,
                                         nsIRDFResource* aProperty,
                                         nsIRDFNode* aTarget)
 {
 
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* sourceStr;
         aSource->GetValueConst(&sourceStr);
         const char* propertyStr;
         aProperty->GetValueConst(&propertyStr);
         nsAutoString targetStr;
         nsXULContentUtils::GetTextForNode(aTarget, targetStr);
 
         MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
@@ -1018,17 +1018,17 @@ nsXULTemplateQueryProcessorRDF::Synchron
 }
 
 nsresult
 nsXULTemplateQueryProcessorRDF::Log(const char* aOperation,
                                     nsIRDFResource* aSource,
                                     nsIRDFResource* aProperty,
                                     nsIRDFNode* aTarget)
 {
-    if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsresult rv;
 
         const char* sourceStr;
         rv = aSource->GetValueConst(&sourceStr);
         if (NS_FAILED(rv))
             return rv;
 
         MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG,
@@ -1264,17 +1264,17 @@ nsXULTemplateQueryProcessorRDF::CompileQ
     nsresult rv = NS_OK;
 
     if (aTag == nsGkAtoms::triple) {
         rv = CompileTripleCondition(aQuery, aCondition, aParentNode, aResult);
     }
     else if (aTag == nsGkAtoms::member) {
         rv = CompileMemberCondition(aQuery, aCondition, aParentNode, aResult);
     }
-    else if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_ALWAYS)) {
+    else if (MOZ_LOG_TEST(gXULTemplateLog, PR_LOG_ALWAYS)) {
         nsAutoString tagstr;
         aTag->ToString(tagstr);
 
         nsAutoCString tagstrC;
         tagstrC.AssignWithConversion(tagstr);
         MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("xultemplate[%p] unrecognized condition test <%s>",
                 this, tagstrC.get()));
--- a/extensions/auth/nsAuthGSSAPI.cpp
+++ b/extensions/auth/nsAuthGSSAPI.cpp
@@ -227,17 +227,17 @@ gssInit()
     return NS_OK;
 }
 
 // Generate proper GSSAPI error messages from the major and
 // minor status codes.
 void
 LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char *prefix)
 {
-    if (!PR_LOG_TEST(gNegotiateLog, PR_LOG_DEBUG)) {
+    if (!MOZ_LOG_TEST(gNegotiateLog, PR_LOG_DEBUG)) {
         return;
     }
 
     OM_uint32 new_stat;
     OM_uint32 msg_ctx = 0;
     gss_buffer_desc status1_string;
     gss_buffer_desc status2_string;
     OM_uint32 ret;
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -128,17 +128,17 @@ struct BasicLogger
   // For efficiency, this method exists and copies the logic of the
   // OutputMessage below.  If making any changes here, also make it
   // in the appropriate places in that method.
   static bool ShouldOutputMessage(int aLevel) {
     if (PreferenceAccess::sGfxLogLevel >= aLevel) {
 #if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
       return true;
 #else
-      if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
+      if (MOZ_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
         return true;
       } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) ||
                  (aLevel < LOG_DEBUG)) {
         return true;
       }
 #endif
     }
     return false;
@@ -155,17 +155,17 @@ struct BasicLogger
     //
     // If making any logic changes to this method, you should probably
     // make the corresponding change in the ShouldOutputMessage method
     // above.
     if (PreferenceAccess::sGfxLogLevel >= aLevel) {
 #if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
       printf_stderr("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
 #else
-      if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
+      if (MOZ_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
         PR_LogPrint("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
       } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) ||
                  (aLevel < LOG_DEBUG)) {
         printf("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
       }
 #endif
     }
   }
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -2065,17 +2065,17 @@ LayerManager::InitLog()
     sLog = PR_NewLogModule("Layers");
 }
 
 /*static*/ bool
 LayerManager::IsLogEnabled()
 {
   MOZ_ASSERT(!!sLog,
              "layer manager must be created before logging is allowed");
-  return PR_LOG_TEST(sLog, PR_LOG_DEBUG);
+  return MOZ_LOG_TEST(sLog, PR_LOG_DEBUG);
 }
 
 void
 PrintInfo(std::stringstream& aStream, LayerComposite* aLayerComposite)
 {
   if (!aLayerComposite) {
     return;
   }
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -24,27 +24,27 @@
 #include "nsIWindowsRegKey.h"
 
 #include "harfbuzz/hb.h"
 
 using namespace mozilla;
 
 #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
-#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
 
 #define LOG_FONTINIT(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \
                                PR_LOG_DEBUG, args)
-#define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTINIT_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontinit), \
                                    PR_LOG_DEBUG)
 
-#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
+#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_cmapdata), \
                                    PR_LOG_DEBUG)
 
 static __inline void
 BuildKeyNameFromFontName(nsAString &aName)
 {
     if (aName.Length() >= LF_FACESIZE)
         aName.Truncate(LF_FACESIZE - 1);
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -56,17 +56,17 @@ GetFontInfoLog()
     static PRLogModuleInfo *sLog;
     if (!sLog)
         sLog = PR_NewLogModule("fontInfoLog");
     return sLog;
 }
 
 #undef LOG
 #define LOG(args) MOZ_LOG(GetFontInfoLog(), PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(GetFontInfoLog(), PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(GetFontInfoLog(), PR_LOG_DEBUG)
 
 static cairo_user_data_key_t sFTUserFontDataKey;
 
 static __inline void
 BuildKeyNameFromFontName(nsAString &aName)
 {
     ToLowerCase(aName);
 }
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -33,20 +33,20 @@ using namespace mozilla::unicode;
 #ifndef FC_POSTSCRIPT_NAME
 #define FC_POSTSCRIPT_NAME  "postscriptname"      /* String */
 #endif
 
 #define PRINTING_FC_PROPERTY "gfx.printing"
 
 #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
-#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
-#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
+#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_cmapdata), \
                                    PR_LOG_DEBUG)
 
 static const FcChar8*
 ToFcChar8Ptr(const char* aStr)
 {
     return reinterpret_cast<const FcChar8*>(aStr);
 }
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -69,17 +69,17 @@ uint32_t gGlyphExtentsWidthsTotalSize = 
 uint32_t gGlyphExtentsSetupEagerSimple = 0;
 uint32_t gGlyphExtentsSetupEagerTight = 0;
 uint32_t gGlyphExtentsSetupLazyTight = 0;
 uint32_t gGlyphExtentsSetupFallBackToTight = 0;
 #endif
 
 #define LOG_FONTINIT(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \
                                   PR_LOG_DEBUG, args)
-#define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTINIT_ENABLED() MOZ_LOG_TEST( \
                                         gfxPlatform::GetLog(eGfxLog_fontinit), \
                                         PR_LOG_DEBUG)
 
 
 /*
  * gfxFontCache - global cache of gfxFont instances.
  * Expires unused fonts after a short interval;
  * notifies fonts to age their cached shaped-word records;
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -1475,17 +1475,17 @@ gfxFontFamily::FindFontForChar(GlobalFon
         int32_t rank = 0;
 
         if (fe->HasCharacter(aMatchData->mCh)) {
             rank += RANK_MATCHED_CMAP;
             aMatchData->mCount++;
 
             PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun);
 
-            if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_DEBUG))) {
+            if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, PR_LOG_DEBUG))) {
                 uint32_t unicodeRange = FindCharUnicodeRange(aMatchData->mCh);
                 uint32_t script = GetScriptCode(aMatchData->mCh);
                 MOZ_LOG(log, PR_LOG_DEBUG,\
                        ("(textrun-systemfallback-fonts) char: u+%6.6x "
                         "unicode-range: %d script: %d match: [%s]\n",
                         aMatchData->mCh,
                         unicodeRange, script,
                         NS_ConvertUTF16toUTF8(fe->Name()).get()));
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -37,21 +37,21 @@ using namespace mozilla;
 
 
 #ifndef CLEARTYPE_QUALITY
 #define CLEARTYPE_QUALITY 5
 #endif
 
 #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
-#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
 
-#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
+#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_cmapdata), \
                                    PR_LOG_DEBUG)
 
 static __inline void
 BuildKeyNameFromFontName(nsAString &aName)
 {
     if (aName.Length() >= LF_FACESIZE)
         aName.Truncate(LF_FACESIZE - 1);
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -126,20 +126,20 @@ static void GetStringForNSString(const N
 static NSString* GetNSStringForString(const nsAString& aSrc)
 {
     return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(aSrc.BeginReading())
                                    length:aSrc.Length()];
 }
 
 #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
-#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
-#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
+#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_cmapdata), \
                                    PR_LOG_DEBUG)
 
 #pragma mark-
 
 // Complex scripts will not render correctly unless appropriate AAT or OT
 // layout tables are present.
 // For OpenType, we also check that the GSUB table supports the relevant
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -20,22 +20,22 @@
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/gfx/2D.h"
 
 using namespace mozilla;
 
 #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
-#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
 #define LOG_FONTINIT(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \
                                PR_LOG_DEBUG, args)
-#define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \
+#define LOG_FONTINIT_ENABLED() MOZ_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontinit), \
                                    PR_LOG_DEBUG)
 
 gfxPlatformFontList *gfxPlatformFontList::sPlatformFontList = nullptr;
 
 // Character ranges that require complex-script shaping support in the font,
 // and so should be masked out by ReadCMAP if the necessary layout tables
 // are not present.
@@ -575,17 +575,17 @@ gfxPlatformFontList::SystemFindFontForCh
         common = false;
         fontEntry = GlobalFontFallback(aCh, aRunScript, aStyle, cmapCount,
                                        &fallbackFamily);
     }
     TimeDuration elapsed = TimeStamp::Now() - start;
 
     PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun);
 
-    if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) {
+    if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, PR_LOG_WARNING))) {
         uint32_t unicodeRange = FindCharUnicodeRange(aCh);
         int32_t script = mozilla::unicode::GetScriptCode(aCh);
         MOZ_LOG(log, PR_LOG_WARNING,\
                ("(textrun-systemfallback-%s) char: u+%6.6x "
                  "unicode-range: %d script: %d match: [%s]"
                 " time: %dus cmaps: %d\n",
                 (common ? "common" : "global"), aCh,
                  unicodeRange, script,
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -2218,17 +2218,17 @@ gfxFontGroup::InitTextRun(gfxContext *aC
 
     // variant fallback handling may end up passing through this twice
     bool redo;
     do {
         redo = false;
 
         if (sizeof(T) == sizeof(uint8_t) && !transformedString) {
 
-            if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) {
+            if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, PR_LOG_WARNING))) {
                 nsAutoCString lang;
                 mStyle.language->ToUTF8String(lang);
                 nsAutoString families;
                 mFamilyList.ToString(families);
                 nsAutoCString str((const char*)aString, aLength);
                 MOZ_LOG(log, PR_LOG_WARNING,\
                        ("(%s) fontgroup: [%s] default: %s lang: %s script: %d "
                         "len %d weight: %d width: %d style: %s size: %6.2f %d-byte "
@@ -2266,17 +2266,17 @@ gfxFontGroup::InitTextRun(gfxContext *aC
             // split into script runs so that script can potentially influence
             // the font matching process below
             gfxScriptItemizer scriptRuns(textPtr, aLength);
 
             uint32_t runStart = 0, runLimit = aLength;
             int32_t runScript = MOZ_SCRIPT_LATIN;
             while (scriptRuns.Next(runStart, runLimit, runScript)) {
 
-                if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) {
+                if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, PR_LOG_WARNING))) {
                     nsAutoCString lang;
                     mStyle.language->ToUTF8String(lang);
                     nsAutoString families;
                     mFamilyList.ToString(families);
                     uint32_t runLen = runLimit - runStart;
                     MOZ_LOG(log, PR_LOG_WARNING,\
                            ("(%s) fontgroup: [%s] default: %s lang: %s script: %d "
                             "len %d weight: %d width: %d style: %s size: %6.2f "
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -29,17 +29,17 @@ gfxUserFontSet::GetUserFontsLog()
 {
     static PRLogModuleInfo* sLog;
     if (!sLog)
         sLog = PR_NewLogModule("userfonts");
     return sLog;
 }
 
 #define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG)
 
 static uint64_t sFontSetGeneration = 0;
 
 // Based on ots::ExpandingMemoryStream from ots-memory-stream.h,
 // adapted to use Mozilla allocators and to allow the final
 // memory buffer to be adopted by the client.
 class ExpandingMemoryStream : public ots::OTSStream {
 public:
--- a/image/ProgressTracker.cpp
+++ b/image/ProgressTracker.cpp
@@ -159,17 +159,17 @@ class AsyncNotifyRunnable : public nsRun
     nsTArray<nsRefPtr<IProgressObserver>> mObservers;
 };
 
 void
 ProgressTracker::Notify(IProgressObserver* aObserver)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsRefPtr<Image> image = GetImage();
     if (image && image->GetURI()) {
       nsRefPtr<ImageURL> uri(image->GetURI());
       nsAutoCString spec;
       uri->GetSpec(spec);
       LOG_FUNC_WITH_PARAM(GetImgLog(),
                           "ProgressTracker::Notify async", "uri", spec.get());
     } else {
@@ -228,17 +228,17 @@ class AsyncNotifyCurrentStateRunnable : 
     nsRefPtr<Image> mImage;
 };
 
 void
 ProgressTracker::NotifyCurrentState(IProgressObserver* aObserver)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsRefPtr<Image> image = GetImage();
     nsAutoCString spec;
     if (image && image->GetURI()) {
       image->GetURI()->GetSpec(spec);
     }
     LOG_FUNC_WITH_PARAM(GetImgLog(),
                         "ProgressTracker::NotifyCurrentState", "uri", spec.get());
   }
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -889,17 +889,17 @@ imgCacheEntry::UpdateCache(int32_t diff 
   if (!Evicted() && HasNoProxies()) {
     mLoader->CacheEntriesChanged(mRequest->IsChrome(), diff);
   }
 }
 
 void
 imgCacheEntry::SetHasNoProxies(bool hasNoProxies)
 {
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     if (hasNoProxies) {
       LOG_FUNC_WITH_PARAM(GetImgLog(), "imgCacheEntry::SetHasNoProxies true",
                           "uri", mRequest->CacheKey().Spec());
     } else {
       LOG_FUNC_WITH_PARAM(GetImgLog(), "imgCacheEntry::SetHasNoProxies false",
                           "uri", mRequest->CacheKey().Spec());
     }
   }
@@ -1067,17 +1067,17 @@ imgCacheExpirationTracker::imgCacheExpir
 
 void
 imgCacheExpirationTracker::NotifyExpired(imgCacheEntry* entry)
 {
   // Hold on to a reference to this entry, because the expiration tracker
   // mechanism doesn't.
   nsRefPtr<imgCacheEntry> kungFuDeathGrip(entry);
 
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsRefPtr<imgRequest> req = entry->GetRequest();
     if (req) {
       LOG_FUNC_WITH_PARAM(GetImgLog(),
                          "imgCacheExpirationTracker::NotifyExpired",
                          "entry", req->CacheKey().Spec());
     }
   }
 
@@ -1528,17 +1528,17 @@ imgLoader::CheckCacheLimits(imgCacheTabl
 
   // Remove entries from the cache until we're back at our desired max size.
   while (queue.GetSize() > sCacheMaxSize) {
     // Remove the first entry in the queue.
     nsRefPtr<imgCacheEntry> entry(queue.Pop());
 
     NS_ASSERTION(entry, "imgLoader::CheckCacheLimits -- NULL entry pointer");
 
-    if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
       nsRefPtr<imgRequest> req = entry->GetRequest();
       if (req) {
         LOG_STATIC_FUNC_WITH_PARAM(GetImgLog(),
                                    "imgLoader::CheckCacheLimits",
                                    "entry", req->CacheKey().Spec());
       }
     }
 
@@ -1764,17 +1764,17 @@ imgLoader::ValidateEntry(imgCacheEntry* 
     }
 
     // Determine whether the cache aEntry must be revalidated...
     validateRequest = ShouldRevalidateEntry(aEntry, aLoadFlags, hasExpired);
 
     MOZ_LOG(GetImgLog(), PR_LOG_DEBUG,
            ("imgLoader::ValidateEntry validating cache entry. "
             "validateRequest = %d", validateRequest));
-  } else if (!key && PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  } else if (!key && MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsAutoCString spec;
     aURI->GetSpec(spec);
 
     MOZ_LOG(GetImgLog(), PR_LOG_DEBUG,
            ("imgLoader::ValidateEntry BYPASSING cache validation for %s "
             "because of NULL LoadID", spec.get()));
   }
 
@@ -2795,17 +2795,17 @@ imgCacheValidator::OnStartRequest(nsIReq
   // data that's coming in off the channel.
   nsCOMPtr<nsIURI> uri;
   {
     nsRefPtr<ImageURL> imageURL;
     mRequest->GetURI(getter_AddRefs(imageURL));
     uri = imageURL->ToIURI();
   }
 
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsAutoCString spec;
     uri->GetSpec(spec);
     LOG_MSG_WITH_PARAM(GetImgLog(),
                        "imgCacheValidator::OnStartRequest creating new request",
                        "uri", spec.get());
   }
 
   int32_t corsmode = mRequest->GetCORSMode();
--- a/image/imgRequest.cpp
+++ b/image/imgRequest.cpp
@@ -46,17 +46,17 @@ PRLogModuleInfo*
 GetImgLog()
 {
   static PRLogModuleInfo* sImgLog;
   if (!sImgLog) {
     sImgLog = PR_NewLogModule("imgRequest");
   }
   return sImgLog;
 }
-#define LOG_TEST(level) (GetImgLog() && PR_LOG_TEST(GetImgLog(), (level)))
+#define LOG_TEST(level) (GetImgLog() && MOZ_LOG_TEST(GetImgLog(), (level)))
 
 NS_IMPL_ISUPPORTS(imgRequest,
                   nsIStreamListener, nsIRequestObserver,
                   nsIThreadRetargetableStreamListener,
                   nsIChannelEventSink,
                   nsIInterfaceRequestor,
                   nsIAsyncVerifyRedirectCallback)
 
@@ -255,17 +255,17 @@ imgRequest::RemoveProxy(imgRequestProxy*
     // been cancelled and thus removed from the cache, tell the image loader so
     // we can be evicted from the cache.
     if (mCacheEntry) {
       MOZ_ASSERT(mURI, "Removing last observer without key uri.");
 
       if (mLoader) {
         mLoader->SetHasNoProxies(this, mCacheEntry);
       }
-    } else if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+    } else if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
       nsAutoCString spec;
       mURI->GetSpec(spec);
       LOG_MSG_WITH_PARAM(GetImgLog(),
                          "imgRequest::RemoveProxy no cache entry",
                          "uri", spec.get());
     }
 
     /* If |aStatus| is a failure code, then cancel the load if it is still in
--- a/image/imgRequestProxy.cpp
+++ b/image/imgRequestProxy.cpp
@@ -856,17 +856,17 @@ imgRequestProxy::Notify(int32_t aType, c
   nsCOMPtr<imgINotificationObserver> listener(mListener);
 
   mListener->Notify(this, aType, aRect);
 }
 
 void
 imgRequestProxy::OnLoadComplete(bool aLastPart)
 {
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsAutoCString name;
     GetName(name);
     LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::OnLoadComplete",
                         "name", name.get());
   }
 
   // There's all sorts of stuff here that could kill us (the OnStopRequest call
   // on the listener, the removal from the loadgroup, the release of the
@@ -902,33 +902,33 @@ imgRequestProxy::OnLoadComplete(bool aLa
     mListenerIsStrongRef = false;
     NS_RELEASE(obs);
   }
 }
 
 void
 imgRequestProxy::BlockOnload()
 {
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsAutoCString name;
     GetName(name);
     LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::BlockOnload",
                         "name", name.get());
   }
 
   nsCOMPtr<imgIOnloadBlocker> blocker = do_QueryInterface(mListener);
   if (blocker) {
     blocker->BlockOnload(this);
   }
 }
 
 void
 imgRequestProxy::UnblockOnload()
 {
-  if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) {
     nsAutoCString name;
     GetName(name);
     LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::UnblockOnload",
                         "name", name.get());
   }
 
   nsCOMPtr<imgIOnloadBlocker> blocker = do_QueryInterface(mListener);
   if (blocker) {
--- a/js/xpconnect/src/XPCLog.cpp
+++ b/js/xpconnect/src/XPCLog.cpp
@@ -26,17 +26,17 @@ static char*    g_Spaces;
 static int      g_InitState = 0;
 static int      g_Indent = 0;
 static PRLogModuleInfo* g_LogMod = nullptr;
 
 static bool Init()
 {
     g_LogMod = PR_NewLogModule("xpclog");
     g_Spaces = new char[SPACE_COUNT+1];
-    if (!g_LogMod || !g_Spaces || !PR_LOG_TEST(g_LogMod,1)) {
+    if (!g_LogMod || !g_Spaces || !MOZ_LOG_TEST(g_LogMod,1)) {
         g_InitState = 1;
         XPC_Log_Finish();
         return false;
     }
     memset(g_Spaces, ' ', SPACE_COUNT);
     g_Spaces[SPACE_COUNT] = 0;
     g_InitState = 1;
     return true;
@@ -66,17 +66,17 @@ XPC_Log_print(const char* fmt, ...)
         PR_LogPrint("%s%s",g_Spaces+SPACE_COUNT-(INDENT_FACTOR*g_Indent),line);
     else
         PR_LogPrint("%s",line);
 }
 
 bool
 XPC_Log_Check(int i)
 {
-    return CAN_RUN && PR_LOG_TEST(g_LogMod,1);
+    return CAN_RUN && MOZ_LOG_TEST(g_LogMod,1);
 }
 
 void
 XPC_Log_Indent()
 {
     if (INDENT_FACTOR*(++g_Indent) > SPACE_COUNT)
         g_Indent-- ;
 }
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -1000,17 +1000,17 @@ LogTextPerfStats(gfxTextPerfMetrics* aTe
   PRLogModuleInfo* tpLog = gfxPlatform::GetLog(eGfxLog_textperf);
 
   // ignore XUL contexts unless at debug level
   PRLogModuleLevel logLevel = PR_LOG_WARNING;
   if (aCounts.numContentTextRuns == 0) {
     logLevel = PR_LOG_DEBUG;
   }
 
-  if (!PR_LOG_TEST(tpLog, logLevel)) {
+  if (!MOZ_LOG_TEST(tpLog, logLevel)) {
     return;
   }
 
   char prefix[256];
 
   switch (aLogType) {
     case eLog_reflow:
       snprintf_literal(prefix, "(textperf-reflow) %p time-ms: %7.0f", aPresShell, aTime);
@@ -2704,17 +2704,17 @@ PresShell::BeginLoad(nsIDocument *aDocum
 {
   mDocumentLoading = true;
 
   gfxTextPerfMetrics *tp = nullptr;
   if (mPresContext) {
     tp = mPresContext->GetTextPerfMetrics();
   }
 
-  bool shouldLog = gLog && PR_LOG_TEST(gLog, PR_LOG_DEBUG);
+  bool shouldLog = gLog && MOZ_LOG_TEST(gLog, PR_LOG_DEBUG);
   if (shouldLog || tp) {
     mLoadBegin = TimeStamp::Now();
   }
 
   if (shouldLog) {
     nsIURI* uri = mDocument->GetDocumentURI();
     nsAutoCString spec;
     if (uri) {
@@ -2740,17 +2740,17 @@ void
 PresShell::LoadComplete()
 {
   gfxTextPerfMetrics *tp = nullptr;
   if (mPresContext) {
     tp = mPresContext->GetTextPerfMetrics();
   }
 
   // log load
-  bool shouldLog = gLog && PR_LOG_TEST(gLog, PR_LOG_DEBUG);
+  bool shouldLog = gLog && MOZ_LOG_TEST(gLog, PR_LOG_DEBUG);
   if (shouldLog || tp) {
     TimeDuration loadTime = TimeStamp::Now() - mLoadBegin;
     nsIURI* uri = mDocument->GetDocumentURI();
     nsAutoCString spec;
     if (uri) {
       uri->GetSpec(spec);
     }
     if (shouldLog) {
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -1702,17 +1702,17 @@ nsPrintEngine::SetupToPrintContent()
     }
 
     if (mPrt->mShrinkRatio < 0.998f) {
       rv = ReconstructAndReflow(true);
       didReconstruction = true;
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
-    if (PR_LOG_TEST(GetPrintingLog(), PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(GetPrintingLog(), PR_LOG_DEBUG)) {
       float calcRatio = 0.0f;
       if (mPrt->mPrintDocList.Length() > 1 && mPrt->mPrintObject->mFrameType == eFrameSet) {
         nsPrintObject* smallestPO = FindSmallestSTF();
         NS_ASSERTION(smallestPO, "There must always be an XMost PO!");
         if (smallestPO) {
           // Calc the shrinkage based on the entire content area
           calcRatio = smallestPO->mShrinkRatio;
         }
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -33,17 +33,17 @@
 #include "nsPresContext.h"
 #include "nsPrintfCString.h"
 #include "nsStyleSet.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \
+#define LOG_ENABLED() MOZ_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \
                                   PR_LOG_DEBUG)
 
 #define FONT_LOADING_API_ENABLED_PREF "layout.css.font-loading-api.enabled"
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(FontFaceSet)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(FontFaceSet, DOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument);
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -265,20 +265,20 @@ GetLoaderLog()
 }
 
 #define LOG_FORCE(args) MOZ_LOG(GetLoaderLog(), PR_LOG_ALWAYS, args)
 #define LOG_ERROR(args) MOZ_LOG(GetLoaderLog(), PR_LOG_ERROR, args)
 #define LOG_WARN(args) MOZ_LOG(GetLoaderLog(), PR_LOG_WARNING, args)
 #define LOG_DEBUG(args) MOZ_LOG(GetLoaderLog(), PR_LOG_DEBUG, args)
 #define LOG(args) LOG_DEBUG(args)
 
-#define LOG_FORCE_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_ALWAYS)
-#define LOG_ERROR_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_ERROR)
-#define LOG_WARN_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_WARNING)
-#define LOG_DEBUG_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_DEBUG)
+#define LOG_FORCE_ENABLED() MOZ_LOG_TEST(GetLoaderLog(), PR_LOG_ALWAYS)
+#define LOG_ERROR_ENABLED() MOZ_LOG_TEST(GetLoaderLog(), PR_LOG_ERROR)
+#define LOG_WARN_ENABLED() MOZ_LOG_TEST(GetLoaderLog(), PR_LOG_WARNING)
+#define LOG_DEBUG_ENABLED() MOZ_LOG_TEST(GetLoaderLog(), PR_LOG_DEBUG)
 #define LOG_ENABLED() LOG_DEBUG_ENABLED()
 
 #define LOG_URI(format, uri)                        \
   PR_BEGIN_MACRO                                    \
     NS_ASSERTION(uri, "Logging null uri");          \
     if (LOG_ENABLED()) {                            \
       nsAutoCString _logURISpec;                    \
       uri->GetSpec(_logURISpec);                    \
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -21,17 +21,17 @@
 #include "nsIContentPolicy.h"
 #include "nsContentPolicyUtils.h"
 
 #include "mozilla/gfx/2D.h"
 
 using namespace mozilla;
 
 #define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \
+#define LOG_ENABLED() MOZ_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \
                                   PR_LOG_DEBUG)
 
 nsFontFaceLoader::nsFontFaceLoader(gfxUserFontEntry* aUserFontEntry,
                                    nsIURI* aFontURI,
                                    mozilla::dom::FontFaceSet* aFontFaceSet,
                                    nsIChannel* aChannel)
   : mUserFontEntry(aUserFontEntry),
     mFontURI(aFontURI),
--- a/media/mtransport/logging.h
+++ b/media/mtransport/logging.h
@@ -24,16 +24,16 @@
     static PRLogModuleInfo* log;                \
     if (!log)                                   \
       log = PR_NewLogModule(n);                 \
     return log;                                 \
   }
 
 #define MOZ_MTLOG(level, b) \
   do {                                                                  \
-    if (PR_LOG_TEST(getLogModule(), level)) {                           \
+    if (MOZ_LOG_TEST(getLogModule(), level)) {                           \
       std::stringstream str;                                            \
       str << b;                                                         \
       MOZ_LOG(getLogModule(), level, ("%s", str.str().c_str()));         \
     }                                                                   \
   } while(0)
 
 #endif // logging_h__
--- a/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp
+++ b/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp
@@ -42,17 +42,17 @@ void CSFLogV(CSFLogLevel priority, const
   vprintf(format, args);
 #else
 
   PRLogModuleLevel level = static_cast<PRLogModuleLevel>(priority);
 
   GetSignalingLogInfo();
 
   // Skip doing any of this work if we're not logging the indicated level...
-  if (!PR_LOG_TEST(gLogModuleInfo,level)) {
+  if (!MOZ_LOG_TEST(gLogModuleInfo,level)) {
     return;
   }
 
   // Trim the path component from the filename
   const char *lastSlash = sourceFile;
   while (*sourceFile) {
     if (*sourceFile == '/' || *sourceFile == '\\') {
       lastSlash = sourceFile;
--- a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
@@ -550,17 +550,17 @@ WebrtcAudioConduit::SendAudioFrame(const
   // if transmission is not started .. conduit cannot insert frames
   if(!mEngineTransmitting)
   {
     CSFLogError(logTag, "%s Engine not transmitting ", __FUNCTION__);
     return kMediaConduitSessionNotInited;
   }
 
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
-    if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
       struct Processing insert = { TimeStamp::Now(), 0 };
       mProcessing.AppendElement(insert);
     }
 #endif
 
   capture_delay = mCaptureDelay;
   //Insert the samples
   if(mPtrVoEXmedia->ExternalRecordingInsertData(audio_data,
@@ -662,17 +662,17 @@ WebrtcAudioConduit::GetAudioFrame(int16_
                   avsync_offset_ms, jitter_buffer_delay_ms, playout_buffer_delay_ms);
     } else {
       CSFLogError(logTag, "A/V sync: GetAVStats failed");
     }
     mLastSyncLog = mSamples;
   }
 
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
-  if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
     if (mProcessing.Length() > 0) {
       unsigned int now;
       mPtrVoEVideoSync->GetPlayoutTimestamp(mChannel, now);
       if (static_cast<uint32_t>(now) != mLastTimestamp) {
         mLastTimestamp = static_cast<uint32_t>(now);
         // Find the block that includes this timestamp in the network input
         while (mProcessing.Length() > 0) {
           // FIX! assumes 20ms @ 48000Hz
@@ -699,17 +699,17 @@ WebrtcAudioConduit::GetAudioFrame(int16_
 MediaConduitErrorCode
 WebrtcAudioConduit::ReceivedRTPPacket(const void *data, int len)
 {
   CSFLogDebug(logTag,  "%s : channel %d", __FUNCTION__, mChannel);
 
   if(mEngineReceiving)
   {
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
-    if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
       // timestamp is at 32 bits in ([1])
       struct Processing insert = { TimeStamp::Now(),
                                    ntohl(static_cast<const uint32_t *>(data)[1]) };
       mProcessing.AppendElement(insert);
     }
 #endif
 
     // XXX we need to get passed the time the packet was received
@@ -837,17 +837,17 @@ WebrtcAudioConduit::StartReceiving()
 
 //WebRTC::RTP Callback Implementation
 // Called on AudioGUM or MSG thread
 int WebrtcAudioConduit::SendPacket(int channel, const void* data, int len)
 {
   CSFLogDebug(logTag,  "%s : channel %d", __FUNCTION__, channel);
 
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
-  if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
     if (mProcessing.Length() > 0) {
       TimeStamp started = mProcessing[0].mTimeStamp;
       mProcessing.RemoveElementAt(0);
       mProcessing.RemoveElementAt(0); // 20ms packetization!  Could automate this by watching sizes
       TimeDuration t = TimeStamp::Now() - started;
       int64_t delta = t.ToMilliseconds();
       LogTime(AsyncLatencyLogger::AudioSendRTP, ((uint64_t) this), delta);
     }
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -360,17 +360,17 @@ bool PCUuidGenerator::Generate(std::stri
   id.ToProvidedString(buffer);
   idp->assign(buffer);
 
   return true;
 }
 
 
 PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal)
-: mTimeCard(PR_LOG_TEST(signalingLogInfo(),PR_LOG_ERROR) ?
+: mTimeCard(MOZ_LOG_TEST(signalingLogInfo(),PR_LOG_ERROR) ?
             create_timecard() : nullptr)
   , mSignalingState(PCImplSignalingState::SignalingStable)
   , mIceConnectionState(PCImplIceConnectionState::New)
   , mIceGatheringState(PCImplIceGatheringState::New)
   , mDtlsConnected(false)
   , mWindow(nullptr)
   , mIdentity(nullptr)
   , mPrivacyRequested(false)
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -47,17 +47,17 @@ static NS_DEFINE_CID(kZipReaderCID, NS_Z
 #endif
 
 //
 // set NSPR_LOG_MODULES=nsJarProtocol:5
 //
 static PRLogModuleInfo *gJarProtocolLog = nullptr;
 
 #define LOG(args)     MOZ_LOG(gJarProtocolLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gJarProtocolLog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(gJarProtocolLog, 4)
 
 //-----------------------------------------------------------------------------
 // nsJARInputThunk
 //
 // this class allows us to do some extra work on the stream transport thread.
 //-----------------------------------------------------------------------------
 
 class nsJARInputThunk : public nsIInputStream
--- a/netwerk/base/BackgroundFileSaver.cpp
+++ b/netwerk/base/BackgroundFileSaver.cpp
@@ -30,17 +30,17 @@
 #endif // XP_WIN
 
 namespace mozilla {
 namespace net {
 
 // NSPR_LOG_MODULES=BackgroundFileSaver:5
 PRLogModuleInfo *BackgroundFileSaver::prlog = nullptr;
 #define LOG(args) MOZ_LOG(BackgroundFileSaver::prlog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(BackgroundFileSaver::prlog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(BackgroundFileSaver::prlog, 4)
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 /**
  * Buffer size for writing to the output file or reading from the input file.
  */
 #define BUFFERED_IO_SIZE (1024 * 32)
--- a/netwerk/base/nsDirectoryIndexStream.cpp
+++ b/netwerk/base/nsDirectoryIndexStream.cpp
@@ -87,17 +87,17 @@ nsDirectoryIndexStream::Init(nsIFile* aD
     nsresult rv;
     bool isDir;
     rv = aDir->IsDirectory(&isDir);
     if (NS_FAILED(rv)) return rv;
     NS_PRECONDITION(isDir, "not a directory");
     if (!isDir)
         return NS_ERROR_ILLEGAL_VALUE;
 
-    if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gLog, PR_LOG_DEBUG)) {
         nsAutoCString path;
         aDir->GetNativePath(path);
         MOZ_LOG(gLog, PR_LOG_DEBUG,
                ("nsDirectoryIndexStream[%p]: initialized on %s",
                 this, path.get()));
     }
 
     // Sigh. We have to allocate on the heap because there are no
@@ -234,17 +234,17 @@ nsDirectoryIndexStream::Read(char* aBuf,
             bool more = mPos < mArray.Count();
             if (!more) break;
 
             // don't addref, for speed - an addref happened when it
             // was placed in the array, so it's not going to go stale
             nsIFile* current = mArray.ObjectAt(mPos);
             ++mPos;
 
-            if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) {
+            if (MOZ_LOG_TEST(gLog, PR_LOG_DEBUG)) {
                 nsAutoCString path;
                 current->GetNativePath(path);
                 MOZ_LOG(gLog, PR_LOG_DEBUG,
                        ("nsDirectoryIndexStream[%p]: iterated %s",
                         this, path.get()));
             }
 
             // rjc: don't return hidden files/directories!
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -320,17 +320,17 @@ nsLoadGroup::Cancel(nsresult status)
         NS_ASSERTION(request, "NULL request found in list.");
 
         if (!PL_DHashTableSearch(&mRequests, request)) {
             // |request| was removed already
             NS_RELEASE(request);
             continue;
         }
 
-        if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
             nsAutoCString nameStr;
             request->GetName(nameStr);
             LOG(("LOADGROUP [%x]: Canceling request %x %s.\n",
                  this, request, nameStr.get()));
         }
 
         //
         // Remove the request from the load group...  This may cause
@@ -388,17 +388,17 @@ nsLoadGroup::Suspend()
     //
     while (count > 0) {
         nsIRequest* request = requests.ElementAt(--count);
 
         NS_ASSERTION(request, "NULL request found in list.");
         if (!request)
             continue;
 
-        if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
             nsAutoCString nameStr;
             request->GetName(nameStr);
             LOG(("LOADGROUP [%x]: Suspending request %x %s.\n",
                 this, request, nameStr.get()));
         }
 
         // Suspend the request...
         rv = request->Suspend();
@@ -440,17 +440,17 @@ nsLoadGroup::Resume()
     //
     while (count > 0) {
         nsIRequest* request = requests.ElementAt(--count);
 
         NS_ASSERTION(request, "NULL request found in list.");
         if (!request)
             continue;
 
-        if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
             nsAutoCString nameStr;
             request->GetName(nameStr);
             LOG(("LOADGROUP [%x]: Resuming request %x %s.\n",
                 this, request, nameStr.get()));
         }
 
         // Resume the request...
         rv = request->Resume();
@@ -529,17 +529,17 @@ nsLoadGroup::SetDefaultLoadRequest(nsIRe
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt)
 {
     nsresult rv;
 
-    if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
         nsAutoCString nameStr;
         request->GetName(nameStr);
         LOG(("LOADGROUP [%x]: Adding request %x %s (count=%d).\n",
              this, request, nameStr.get(), mRequests.EntryCount()));
     }
 
     NS_ASSERTION(!PL_DHashTableSearch(&mRequests, request),
                  "Entry added to loadgroup twice, don't do that");
@@ -626,17 +626,17 @@ nsLoadGroup::AddRequest(nsIRequest *requ
 
 NS_IMETHODIMP
 nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt,
                            nsresult aStatus)
 {
     NS_ENSURE_ARG_POINTER(request);
     nsresult rv;
 
-    if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) {
         nsAutoCString nameStr;
         request->GetName(nameStr);
         LOG(("LOADGROUP [%x]: Removing request %x %s status %x (count=%d).\n",
             this, request, nameStr.get(), aStatus, mRequests.EntryCount() - 1));
     }
 
     // Make sure we have a owning reference to the request we're about
     // to remove.
--- a/netwerk/base/nsSocketTransportService2.h
+++ b/netwerk/base/nsSocketTransportService2.h
@@ -25,24 +25,24 @@ struct PRPollDesc;
 
 //-----------------------------------------------------------------------------
 
 //
 // set NSPR_LOG_MODULES=nsSocketTransport:5
 //
 extern PRLogModuleInfo *gSocketTransportLog;
 #define SOCKET_LOG(args)     MOZ_LOG(gSocketTransportLog, PR_LOG_DEBUG, args)
-#define SOCKET_LOG_ENABLED() PR_LOG_TEST(gSocketTransportLog, PR_LOG_DEBUG)
+#define SOCKET_LOG_ENABLED() MOZ_LOG_TEST(gSocketTransportLog, PR_LOG_DEBUG)
 
 //
 // set NSPR_LOG_MODULES=UDPSocket:5
 //
 extern PRLogModuleInfo *gUDPSocketLog;
 #define UDPSOCKET_LOG(args)     PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args)
-#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
+#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG)
 
 //-----------------------------------------------------------------------------
 
 #define NS_SOCKET_POLL_TIMEOUT PR_INTERVAL_NO_TIMEOUT
 
 //-----------------------------------------------------------------------------
 
 namespace mozilla {
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -41,17 +41,17 @@ char nsStandardURL::gHostLimitDigits[] =
 // setenv NSPR_LOG_MODULES nsStandardURL:5
 //
 static PRLogModuleInfo *gStandardURLLog;
 
 // The Chromium code defines its own LOG macro which we don't want
 #undef LOG
 #define LOG(args)     MOZ_LOG(gStandardURLLog, PR_LOG_DEBUG, args)
 #undef LOG_ENABLED
-#define LOG_ENABLED() PR_LOG_TEST(gStandardURLLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gStandardURLLog, PR_LOG_DEBUG)
 
 //----------------------------------------------------------------------------
 
 #define ENSURE_MUTABLE() \
   PR_BEGIN_MACRO \
     if (!mMutable) { \
         NS_WARNING("attempt to modify an immutable nsStandardURL"); \
         return NS_ERROR_ABORT; \
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -1762,17 +1762,17 @@ nsCacheService::CreateOfflineDevice()
 
 nsresult
 nsCacheService::CreateCustomOfflineDevice(nsIFile *aProfileDir,
                                           int32_t aQuota,
                                           nsOfflineCacheDevice **aDevice)
 {
     NS_ENSURE_ARG(aProfileDir);
 
-    if (PR_LOG_TEST(gCacheLog, PR_LOG_ALWAYS)) {
+    if (MOZ_LOG_TEST(gCacheLog, PR_LOG_ALWAYS)) {
       nsAutoCString profilePath;
       aProfileDir->GetNativePath(profilePath);
       CACHE_LOG_ALWAYS(("Creating custom offline device, %s, %d",
                         profilePath.BeginReading(), aQuota));
     }
 
     if (!mInitialized)         return NS_ERROR_NOT_AVAILABLE;
     if (!mEnableOfflineDevice) return NS_ERROR_NOT_AVAILABLE;
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -220,17 +220,17 @@ nsOfflineCacheEvictionFunction::OnFuncti
 }
 
 void
 nsOfflineCacheEvictionFunction::Apply()
 {
   LOG(("nsOfflineCacheEvictionFunction::Apply\n"));
 
   for (int32_t i = 0; i < mItems.Count(); i++) {
-    if (PR_LOG_TEST(gCacheLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gCacheLog, PR_LOG_DEBUG)) {
       nsAutoCString path;
       mItems[i]->GetNativePath(path);
       LOG(("  removing %s\n", path.get()));
     }
 
     mItems[i]->Remove(false);
   }
 
--- a/netwerk/cache2/CacheLog.h
+++ b/netwerk/cache2/CacheLog.h
@@ -7,14 +7,14 @@
 
 #include "mozilla/Logging.h"
 
 namespace mozilla {
 namespace net {
 
 extern PRLogModuleInfo* GetCache2Log();
 #define LOG(x)  MOZ_LOG(GetCache2Log(), PR_LOG_DEBUG, x)
-#define LOG_ENABLED() PR_LOG_TEST(GetCache2Log(), PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(GetCache2Log(), PR_LOG_DEBUG)
 
 } // net
 } // mozilla
 
 #endif
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -199,31 +199,31 @@ GetCookieLog()
   return sCookieLog;
 }
 
 #define COOKIE_LOGFAILURE(a, b, c, d)    LogFailure(a, b, c, d)
 #define COOKIE_LOGSUCCESS(a, b, c, d, e) LogSuccess(a, b, c, d, e)
 
 #define COOKIE_LOGEVICTED(a, details)          \
   PR_BEGIN_MACRO                               \
-  if (PR_LOG_TEST(GetCookieLog(), PR_LOG_DEBUG))  \
+  if (MOZ_LOG_TEST(GetCookieLog(), PR_LOG_DEBUG))  \
       LogEvicted(a, details);                  \
   PR_END_MACRO
 
 #define COOKIE_LOGSTRING(lvl, fmt)   \
   PR_BEGIN_MACRO                     \
     MOZ_LOG(GetCookieLog(), lvl, fmt);  \
     MOZ_LOG(GetCookieLog(), lvl, ("\n")); \
   PR_END_MACRO
 
 static void
 LogFailure(bool aSetCookie, nsIURI *aHostURI, const char *aCookieString, const char *aReason)
 {
   // if logging isn't enabled, return now to save cycles
-  if (!PR_LOG_TEST(GetCookieLog(), PR_LOG_WARNING))
+  if (!MOZ_LOG_TEST(GetCookieLog(), PR_LOG_WARNING))
     return;
 
   nsAutoCString spec;
   if (aHostURI)
     aHostURI->GetAsciiSpec(spec);
 
   MOZ_LOG(GetCookieLog(), PR_LOG_WARNING,
     ("===== %s =====\n", aSetCookie ? "COOKIE NOT ACCEPTED" : "COOKIE NOT SENT"));
@@ -272,17 +272,17 @@ LogCookie(nsCookie *aCookie)
     MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("is httpOnly: %s\n", aCookie->IsHttpOnly() ? "true" : "false"));
   }
 }
 
 static void
 LogSuccess(bool aSetCookie, nsIURI *aHostURI, const char *aCookieString, nsCookie *aCookie, bool aReplacing)
 {
   // if logging isn't enabled, return now to save cycles
-  if (!PR_LOG_TEST(GetCookieLog(), PR_LOG_DEBUG)) {
+  if (!MOZ_LOG_TEST(GetCookieLog(), PR_LOG_DEBUG)) {
     return;
   }
 
   nsAutoCString spec;
   if (aHostURI)
     aHostURI->GetAsciiSpec(spec);
 
   MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,
@@ -346,17 +346,17 @@ class DBListenerErrorHandler : public mo
 protected:
   explicit DBListenerErrorHandler(DBState* dbState) : mDBState(dbState) { }
   nsRefPtr<DBState> mDBState;
   virtual const char *GetOpType() = 0;
 
 public:
   NS_IMETHOD HandleError(mozIStorageError* aError) override
   {
-    if (PR_LOG_TEST(GetCookieLog(), PR_LOG_WARNING)) {
+    if (MOZ_LOG_TEST(GetCookieLog(), PR_LOG_WARNING)) {
       int32_t result = -1;
       aError->GetResult(&result);
 
       nsAutoCString message;
       aError->GetMessage(message);
       COOKIE_LOGSTRING(PR_LOG_WARNING,
         ("DBListenerErrorHandler::HandleError(): Error %d occurred while "
          "performing operation '%s' with message '%s'; rebuilding database.",
--- a/netwerk/protocol/http/HttpLog.h
+++ b/netwerk/protocol/http/HttpLog.h
@@ -39,16 +39,16 @@ extern PRLogModuleInfo *gHttpLog;
 // http logging
 #define LOG1(args) MOZ_LOG(gHttpLog, 1, args)
 #define LOG2(args) MOZ_LOG(gHttpLog, 2, args)
 #define LOG3(args) MOZ_LOG(gHttpLog, 3, args)
 #define LOG4(args) MOZ_LOG(gHttpLog, 4, args)
 #define LOG5(args) MOZ_LOG(gHttpLog, 5, args)
 #define LOG(args) LOG4(args)
 
-#define LOG1_ENABLED() PR_LOG_TEST(gHttpLog, 1)
-#define LOG2_ENABLED() PR_LOG_TEST(gHttpLog, 2)
-#define LOG3_ENABLED() PR_LOG_TEST(gHttpLog, 3)
-#define LOG4_ENABLED() PR_LOG_TEST(gHttpLog, 4)
-#define LOG5_ENABLED() PR_LOG_TEST(gHttpLog, 5)
+#define LOG1_ENABLED() MOZ_LOG_TEST(gHttpLog, 1)
+#define LOG2_ENABLED() MOZ_LOG_TEST(gHttpLog, 2)
+#define LOG3_ENABLED() MOZ_LOG_TEST(gHttpLog, 3)
+#define LOG4_ENABLED() MOZ_LOG_TEST(gHttpLog, 4)
+#define LOG5_ENABLED() MOZ_LOG_TEST(gHttpLog, 5)
 #define LOG_ENABLED() LOG4_ENABLED()
 
 #endif // HttpLog_h__
--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
@@ -442,16 +442,16 @@ nsResProtocolHandler::ResolveURI(nsIURI 
         return NS_ERROR_MALFORMED_URI;
 
     nsCOMPtr<nsIURI> baseURI;
     rv = GetSubstitution(host, getter_AddRefs(baseURI));
     if (NS_FAILED(rv)) return rv;
 
     rv = baseURI->Resolve(nsDependentCString(p, path.Length()-1), result);
 
-    if (PR_LOG_TEST(gResLog, PR_LOG_DEBUG)) {
+    if (MOZ_LOG_TEST(gResLog, PR_LOG_DEBUG)) {
         nsAutoCString spec;
         uri->GetAsciiSpec(spec);
         MOZ_LOG(gResLog, PR_LOG_DEBUG,
                ("%s\n -> %s\n", spec.get(), PromiseFlatCString(result).get()));
     }
     return rv;
 }
--- a/netwerk/protocol/wyciwyg/nsWyciwyg.h
+++ b/netwerk/protocol/wyciwyg/nsWyciwyg.h
@@ -27,17 +27,17 @@ extern PRLogModuleInfo *gWyciwygLog;
 
 // http logging
 #define LOG1(args) MOZ_LOG(gWyciwygLog, 1, args)
 #define LOG2(args) MOZ_LOG(gWyciwygLog, 2, args)
 #define LOG3(args) MOZ_LOG(gWyciwygLog, 3, args)
 #define LOG4(args) MOZ_LOG(gWyciwygLog, 4, args)
 #define LOG(args) LOG4(args)
 
-#define LOG1_ENABLED() PR_LOG_TEST(gWyciwygLog, 1)
-#define LOG2_ENABLED() PR_LOG_TEST(gWyciwygLog, 2)
-#define LOG3_ENABLED() PR_LOG_TEST(gWyciwygLog, 3)
-#define LOG4_ENABLED() PR_LOG_TEST(gWyciwygLog, 4)
+#define LOG1_ENABLED() MOZ_LOG_TEST(gWyciwygLog, 1)
+#define LOG2_ENABLED() MOZ_LOG_TEST(gWyciwygLog, 2)
+#define LOG3_ENABLED() MOZ_LOG_TEST(gWyciwygLog, 3)
+#define LOG4_ENABLED() MOZ_LOG_TEST(gWyciwygLog, 4)
 #define LOG_ENABLED() LOG4_ENABLED()
 
 #define WYCIWYG_TYPE "text/html"
 
 #endif // nsWyciwyg_h__
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -173,17 +173,17 @@ receive_cb(struct socket* sock, union sc
 }
 
 static void
 debug_printf(const char *format, ...)
 {
   va_list ap;
   char buffer[1024];
 
-  if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_ALWAYS)) {
+  if (MOZ_LOG_TEST(GetSCTPLog(), PR_LOG_ALWAYS)) {
     va_start(ap, format);
 #ifdef _WIN32
     if (vsnprintf_s(buffer, sizeof(buffer), _TRUNCATE, format, ap) > 0) {
 #else
     if (vsnprintf(buffer, sizeof(buffer), format, ap) > 0) {
 #endif
       PR_LogPrint("%s", buffer);
     }
@@ -330,17 +330,17 @@ DataChannelConnection::Init(unsigned sho
         LOG(("sctp_init(%u)", aPort));
         usrsctp_init(aPort,
                      nullptr,
                      debug_printf
                     );
       }
 
       // Set logging to SCTP:PR_LOG_DEBUG to get SCTP debugs
-      if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_ALWAYS)) {
+      if (MOZ_LOG_TEST(GetSCTPLog(), PR_LOG_ALWAYS)) {
         usrsctp_sysctl_set_sctp_debug_on(SCTP_DEBUG_ALL);
       }
 
       usrsctp_sysctl_set_sctp_blackhole(2);
       // ECN is currently not supported by the Firefox code
       usrsctp_sysctl_set_sctp_ecn_enable(0);
       sctp_initialized = true;
 
@@ -648,17 +648,17 @@ DataChannelConnection::ProcessQueuedOpen
     }
   }
 
 }
 void
 DataChannelConnection::SctpDtlsInput(TransportFlow *flow,
                                      const unsigned char *data, size_t len)
 {
-  if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) {
     char *buf;
 
     if ((buf = usrsctp_dumppacket((void *)data, len, SCTP_DUMP_INBOUND)) != nullptr) {
       PR_LogPrint("%s", buf);
       usrsctp_freedumpbuffer(buf);
     }
   }
   // Pass the data to SCTP
@@ -678,17 +678,17 @@ DataChannelConnection::SendPacket(unsign
 /* static */
 int
 DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, size_t length,
                                       uint8_t tos, uint8_t set_df)
 {
   DataChannelConnection *peer = static_cast<DataChannelConnection *>(addr);
   int res;
 
-  if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) {
     char *buf;
 
     if ((buf = usrsctp_dumppacket(buffer, length, SCTP_DUMP_OUTBOUND)) != nullptr) {
       PR_LogPrint("%s", buf);
       usrsctp_freedumpbuffer(buf);
     }
   }
   // We're async proxying even if on the STSThread because this is called
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -419,17 +419,17 @@ nsSOCKSSocketInfo::ConnectToProxy(PRFile
         rv = mDnsRec->GetNextAddr(mProxyPort, &mInternalProxyAddr);
         // No more addresses to try? If so, we'll need to bail
         if (NS_FAILED(rv)) {
             LOGERROR(("socks: unable to connect to SOCKS proxy, %s",
                      mProxyHost.get()));
             return PR_FAILURE;
         }
 
-        if (PR_LOG_TEST(gSOCKSLog, PR_LOG_DEBUG)) {
+        if (MOZ_LOG_TEST(gSOCKSLog, PR_LOG_DEBUG)) {
           char buf[kIPv6CStrBufSize];
           NetAddrToString(&mInternalProxyAddr, buf, sizeof(buf));
           LOGDEBUG(("socks: trying proxy server, %s:%hu",
                    buf, ntohs(mInternalProxyAddr.inet.port)));
         }
 
         NetAddr proxy = mInternalProxyAddr;
         FixupAddressFamily(fd, &proxy);
--- a/rdf/base/nsInMemoryDataSource.cpp
+++ b/rdf/base/nsInMemoryDataSource.cpp
@@ -844,17 +844,17 @@ NS_INTERFACE_MAP_END
 
 void
 InMemoryDataSource::LogOperation(const char* aOperation,
                                  nsIRDFResource* aSource,
                                  nsIRDFResource* aProperty,
                                  nsIRDFNode* aTarget,
                                  bool aTruthValue)
 {
-    if (! PR_LOG_TEST(gLog, PR_LOG_NOTICE))
+    if (! MOZ_LOG_TEST(gLog, PR_LOG_NOTICE))
         return;
 
     nsXPIDLCString uri;
     aSource->GetValue(getter_Copies(uri));
     PR_LogPrint
            ("InMemoryDataSource(%p): %s", this, aOperation);
 
     PR_LogPrint
--- a/rdf/base/nsRDFContentSink.cpp
+++ b/rdf/base/nsRDFContentSink.cpp
@@ -318,17 +318,17 @@ RDFContentSinkImpl::~RDFContentSinkImpl(
             nsIRDFResource* resource = nullptr;
             RDFContentSinkState state;
             RDFContentSinkParseMode parseMode;
             PopContext(resource, state, parseMode);
 
             // print some fairly useless debugging info
             // XXX we should save line numbers on the context stack: this'd
             // be about 1000x more helpful.
-            if (resource && PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
+            if (resource && MOZ_LOG_TEST(gLog, PR_LOG_NOTICE)) {
                 nsXPIDLCString uri;
                 resource->GetValue(getter_Copies(uri));
                 MOZ_LOG(gLog, PR_LOG_NOTICE,
                        ("rdfxml:   uri=%s", (const char*) uri));
             }
 
             NS_IF_RELEASE(resource);
         }
@@ -433,17 +433,17 @@ RDFContentSinkImpl::HandleStartElement(c
 NS_IMETHODIMP 
 RDFContentSinkImpl::HandleEndElement(const char16_t *aName)
 {
   FlushText();
 
   nsIRDFResource* resource;
   if (NS_FAILED(PopContext(resource, mState, mParseMode))) {
       // XXX parser didn't catch unmatched tags?
-      if (PR_LOG_TEST(gLog, PR_LOG_WARNING)) {
+      if (MOZ_LOG_TEST(gLog, PR_LOG_WARNING)) {
           nsAutoString tagStr(aName);
           char* tagCStr = ToNewCString(tagStr);
 
           PR_LogPrint
                  ("rdfxml: extra close tag '%s' at line %d",
                   tagCStr, 0/*XXX fix me */);
 
           free(tagCStr);
--- a/rdf/base/nsRDFXMLDataSource.cpp
+++ b/rdf/base/nsRDFXMLDataSource.cpp
@@ -822,17 +822,17 @@ RDFXMLDataSourceImpl::Flush(void)
     if (!mIsWritable || !mIsDirty)
         return NS_OK;
 
     // while it is not fatal if mURL is not set,
     // indicate failure since we can't flush back to an unknown origin
     if (! mURL)
         return NS_ERROR_NOT_INITIALIZED;
 
-    if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gLog, PR_LOG_NOTICE)) {
       nsAutoCString spec;
       mURL->GetSpec(spec);
       MOZ_LOG(gLog, PR_LOG_NOTICE,
              ("rdfxml[%p] flush(%s)", this, spec.get()));
     }
 
     nsresult rv;
     if (NS_SUCCEEDED(rv = rdfXMLFlush(mURL)))
@@ -964,17 +964,17 @@ RDFXMLDataSourceImpl::Refresh(bool aBloc
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 RDFXMLDataSourceImpl::BeginLoad(void)
 {
-    if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gLog, PR_LOG_NOTICE)) {
       nsAutoCString spec;
       if (mURL) {
           mURL->GetSpec(spec);
       }
       MOZ_LOG(gLog, PR_LOG_NOTICE,
              ("rdfxml[%p] begin-load(%s)", this, spec.get()));
     }
     
@@ -990,17 +990,17 @@ RDFXMLDataSourceImpl::BeginLoad(void)
         }
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP
 RDFXMLDataSourceImpl::Interrupt(void)
 {
-    if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gLog, PR_LOG_NOTICE)) {
       nsAutoCString spec;
       if (mURL) {
           mURL->GetSpec(spec);
       }
       MOZ_LOG(gLog, PR_LOG_NOTICE,
              ("rdfxml[%p] interrupt(%s)", this, spec.get()));
     }
 
@@ -1015,17 +1015,17 @@ RDFXMLDataSourceImpl::Interrupt(void)
         }
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP
 RDFXMLDataSourceImpl::Resume(void)
 {
-    if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gLog, PR_LOG_NOTICE)) {
       nsAutoCString spec;
       if (mURL) {
           mURL->GetSpec(spec);
       }
       MOZ_LOG(gLog, PR_LOG_NOTICE,
              ("rdfxml[%p] resume(%s)", this, spec.get()));
     }
     
@@ -1040,17 +1040,17 @@ RDFXMLDataSourceImpl::Resume(void)
         }
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP
 RDFXMLDataSourceImpl::EndLoad(void)
 {
-    if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) {
+    if (MOZ_LOG_TEST(gLog, PR_LOG_NOTICE)) {
       nsAutoCString spec;
       if (mURL) {
           mURL->GetSpec(spec);
       }
       MOZ_LOG(gLog, PR_LOG_NOTICE,
              ("rdfxml[%p] end-load(%s)", this, spec.get()));
     }
     
--- a/security/manager/ssl/nsNTLMAuthModule.cpp
+++ b/security/manager/ssl/nsNTLMAuthModule.cpp
@@ -34,17 +34,17 @@ GetNTLMLog()
 {
   static PRLogModuleInfo *sNTLMLog;
   if (!sNTLMLog)
     sNTLMLog = PR_NewLogModule("NTLM");
   return sNTLMLog;
 }
 
 #define LOG(x) MOZ_LOG(GetNTLMLog(), PR_LOG_DEBUG, x)
-#define LOG_ENABLED() PR_LOG_TEST(GetNTLMLog(), PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(GetNTLMLog(), PR_LOG_DEBUG)
 
 static void des_makekey(const uint8_t *raw, uint8_t *key);
 static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash);
 
 //-----------------------------------------------------------------------------
 // this file contains a cross-platform NTLM authentication implementation. it
 // is based on documentation from: http://davenport.sourceforge.net/ntlm.html
 //-----------------------------------------------------------------------------
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -123,17 +123,17 @@ NS_IMPL_ISUPPORTS(nsSecureBrowserUIImpl,
                   nsISecureBrowserUI,
                   nsIWebProgressListener,
                   nsISupportsWeakReference,
                   nsISSLStatusProvider)
 
 NS_IMETHODIMP
 nsSecureBrowserUIImpl::Init(nsIDOMWindow *aWindow)
 {
-  if (PR_LOG_TEST(gSecureDocLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gSecureDocLog, PR_LOG_DEBUG)) {
     nsCOMPtr<nsIDOMWindow> window(do_QueryReferent(mWindow));
 
     MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG,
            ("SecureUI:%p: Init: mWindow: %p, aWindow: %p\n", this,
             window.get(), aWindow));
   }
 
   if (!aWindow) {
@@ -631,17 +631,17 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
 
   if (!aRequest)
   {
     MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG,
            ("SecureUI:%p: OnStateChange with null request\n", this));
     return NS_ERROR_NULL_POINTER;
   }
 
-  if (PR_LOG_TEST(gSecureDocLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gSecureDocLog, PR_LOG_DEBUG)) {
     nsXPIDLCString reqname;
     aRequest->GetName(reqname);
     MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG,
            ("SecureUI:%p: %p %p OnStateChange %x %s\n", this, aWebProgress,
             aRequest, aProgressStateFlags, reqname.get()));
   }
 
   nsCOMPtr<nsISupports> securityInfo(ExtractSecurityInfo(aRequest));
--- a/storage/VacuumManager.cpp
+++ b/storage/VacuumManager.cpp
@@ -239,17 +239,17 @@ Vacuumer::HandleError(mozIStorageError *
   warnMsg.Append(mDBFilename);
   warnMsg.AppendLiteral(" - ");
   warnMsg.AppendInt(result);
   warnMsg.Append(' ');
   warnMsg.Append(message);
   NS_WARNING(warnMsg.get());
 #endif
 
-  if (PR_LOG_TEST(gStorageLog, PR_LOG_ERROR)) {
+  if (MOZ_LOG_TEST(gStorageLog, PR_LOG_ERROR)) {
     int32_t result;
     nsresult rv = aError->GetResult(&result);
     NS_ENSURE_SUCCESS(rv, rv);
     nsAutoCString message;
     rv = aError->GetMessage(message);
     NS_ENSURE_SUCCESS(rv, rv);
     MOZ_LOG(gStorageLog, PR_LOG_ERROR,
            ("Vacuum failed with error: %d '%s'. Database was: '%s'",
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -689,17 +689,17 @@ Connection::initializeInternal()
   // Properly wrap the database handle's mutex.
   sharedDBMutex.initWithMutex(sqlite3_db_mutex(mDBConn));
 
   if (!gStorageLog)
     gStorageLog = ::PR_NewLogModule("mozStorage");
 
   // SQLite tracing can slow down queries (especially long queries)
   // significantly. Don't trace unless the user is actively monitoring SQLite.
-  if (PR_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) {
     ::sqlite3_trace(mDBConn, tracefunc, this);
 
     MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Opening connection to '%s' (%p)",
                                         mTelemetryFilename.get(), this));
   }
 
   int64_t pageSize = Service::getDefaultPageSize();
 
@@ -918,17 +918,17 @@ Connection::internalClose(sqlite3 *aNati
 #ifdef DEBUG
   { // Make sure we have marked our async thread as shutting down.
     MutexAutoLock lockedScope(sharedAsyncExecutionMutex);
     NS_ASSERTION(mAsyncExecutionThreadShuttingDown,
                  "Did not call setClosedState!");
   }
 #endif // DEBUG
 
-  if (PR_LOG_TEST(gStorageLog, PR_LOG_NOTICE)) {
+  if (MOZ_LOG_TEST(gStorageLog, PR_LOG_NOTICE)) {
     nsAutoCString leafName(":memory");
     if (mDatabaseFile)
         (void)mDatabaseFile->GetNativeLeafName(leafName);
     MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Closing connection to '%s'",
                                         leafName.get()));
   }
 
   // At this stage, we may still have statements that need to be
--- a/storage/mozStorageStatement.cpp
+++ b/storage/mozStorageStatement.cpp
@@ -599,17 +599,17 @@ Statement::ExecuteStep(bool *_moreResult
       return convertResultCode(srv);
     }
 
     // We have bound, so now we can clear our array.
     mParamsArray = nullptr;
   }
   int srv = mDBConnection->stepStatement(mNativeConnection, mDBStatement);
 
-  if (srv != SQLITE_ROW && srv != SQLITE_DONE && PR_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) {
+  if (srv != SQLITE_ROW && srv != SQLITE_DONE && MOZ_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) {
       nsAutoCString errStr;
       (void)mDBConnection->GetLastErrorString(errStr);
       MOZ_LOG(gStorageLog, PR_LOG_DEBUG,
              ("Statement::ExecuteStep error: %s", errStr.get()));
   }
 
   // SQLITE_ROW and SQLITE_DONE are non-errors
   if (srv == SQLITE_ROW) {
--- a/toolkit/components/downloads/ApplicationReputation.cpp
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -62,17 +62,17 @@ using safe_browsing::ClientDownloadReque
 #define PREF_SB_DOWNLOADS_REMOTE_ENABLED "browser.safebrowsing.downloads.remote.enabled"
 #define PREF_GENERAL_LOCALE "general.useragent.locale"
 #define PREF_DOWNLOAD_BLOCK_TABLE "urlclassifier.downloadBlockTable"
 #define PREF_DOWNLOAD_ALLOW_TABLE "urlclassifier.downloadAllowTable"
 
 // NSPR_LOG_MODULES=ApplicationReputation:5
 PRLogModuleInfo *ApplicationReputationService::prlog = nullptr;
 #define LOG(args) MOZ_LOG(ApplicationReputationService::prlog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(ApplicationReputationService::prlog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(ApplicationReputationService::prlog, PR_LOG_DEBUG)
 
 class PendingDBLookup;
 
 // A single use class private to ApplicationReputationService encapsulating an
 // nsIApplicationReputationQuery and an nsIApplicationReputationCallback. Once
 // created by ApplicationReputationService, it is guaranteed to call mCallback.
 // This class is private to ApplicationReputationService.
 class PendingLookup final : public nsIStreamListener
--- a/toolkit/components/url-classifier/Classifier.cpp
+++ b/toolkit/components/url-classifier/Classifier.cpp
@@ -13,17 +13,17 @@
 #include "nsIFile.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Logging.h"
 
 // NSPR_LOG_MODULES=UrlClassifierDbService:5
 extern PRLogModuleInfo *gUrlClassifierDbServiceLog;
 #define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
 
 #define STORE_DIRECTORY      NS_LITERAL_CSTRING("safebrowsing")
 #define TO_DELETE_DIR_SUFFIX NS_LITERAL_CSTRING("-to_delete")
 #define BACKUP_DIR_SUFFIX    NS_LITERAL_CSTRING("-backup")
 
 namespace mozilla {
 namespace safebrowsing {
 
--- a/toolkit/components/url-classifier/HashStore.cpp
+++ b/toolkit/components/url-classifier/HashStore.cpp
@@ -89,17 +89,17 @@
 //    16-byte MD5 of all preceding data
 
 // Name of the SafeBrowsing store
 #define STORE_SUFFIX ".sbstore"
 
 // NSPR_LOG_MODULES=UrlClassifierDbService:5
 extern PRLogModuleInfo *gUrlClassifierDbServiceLog;
 #define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
 
 // Either the return was successful or we call the Reset function (unless we
 // hit an OOM).  Used while reading in the store.
 #define SUCCESS_OR_RESET(res)                                             \
   do {                                                                    \
     nsresult __rv = res; /* Don't evaluate |res| more than once */        \
     if (__rv == NS_ERROR_OUT_OF_MEMORY) {                                 \
       NS_WARNING("SafeBrowsing OOM.");                                    \
--- a/toolkit/components/url-classifier/LookupCache.cpp
+++ b/toolkit/components/url-classifier/LookupCache.cpp
@@ -30,17 +30,17 @@
 #define CACHE_SUFFIX ".cache"
 
 // Name of the persistent PrefixSet storage
 #define PREFIXSET_SUFFIX  ".pset"
 
 // NSPR_LOG_MODULES=UrlClassifierDbService:5
 extern PRLogModuleInfo *gUrlClassifierDbServiceLog;
 #define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
 
 namespace mozilla {
 namespace safebrowsing {
 
 const uint32_t LOOKUPCACHE_MAGIC = 0x1231af3e;
 const uint32_t CURRENT_VERSION = 2;
 
 LookupCache::LookupCache(const nsACString& aTableName, nsIFile* aStoreDir)
--- a/toolkit/components/url-classifier/ProtocolParser.cpp
+++ b/toolkit/components/url-classifier/ProtocolParser.cpp
@@ -10,17 +10,17 @@
 #include "prnetdb.h"
 #include "prprf.h"
 
 #include "nsUrlClassifierUtils.h"
 
 // NSPR_LOG_MODULES=UrlClassifierDbService:5
 extern PRLogModuleInfo *gUrlClassifierDbServiceLog;
 #define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
 
 namespace mozilla {
 namespace safebrowsing {
 
 // Updates will fail if fed chunks larger than this
 const uint32_t MAX_CHUNK_SIZE = (1024 * 1024);
 // Updates will fail if the total number of tocuhed chunks is larger than this
 const uint32_t MAX_CHUNK_RANGE = 1000000;
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -52,17 +52,17 @@
 #include "nsContentUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::safebrowsing;
 
 // NSPR_LOG_MODULES=UrlClassifierDbService:5
 PRLogModuleInfo *gUrlClassifierDbServiceLog = nullptr;
 #define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG)
 
 // Prefs for implementing nsIURIClassifier to block page loads
 #define CHECK_MALWARE_PREF      "browser.safebrowsing.malware.enabled"
 #define CHECK_MALWARE_DEFAULT   false
 
 #define CHECK_PHISHING_PREF     "browser.safebrowsing.enabled"
 #define CHECK_PHISHING_DEFAULT  false
 
--- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
@@ -20,17 +20,17 @@
 #include "mozilla/FileUtils.h"
 #include "mozilla/Logging.h"
 
 using namespace mozilla;
 
 // NSPR_LOG_MODULES=UrlClassifierPrefixSet:5
 static const PRLogModuleInfo *gUrlClassifierPrefixSetLog = nullptr;
 #define LOG(args) MOZ_LOG(gUrlClassifierPrefixSetLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierPrefixSetLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierPrefixSetLog, PR_LOG_DEBUG)
 
 NS_IMPL_ISUPPORTS(
   nsUrlClassifierPrefixSet, nsIUrlClassifierPrefixSet, nsIMemoryReporter)
 
 MOZ_DEFINE_MALLOC_SIZE_OF(UrlClassifierMallocSizeOf)
 
 nsUrlClassifierPrefixSet::nsUrlClassifierPrefixSet()
   : mTotalPrefixes(0)
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -384,17 +384,17 @@ nsDocLoader::DestroyChildren()
   mChildList.Clear();
 }
 
 NS_IMETHODIMP
 nsDocLoader::OnStartRequest(nsIRequest *request, nsISupports *aCtxt)
 {
   // called each time a request is added to the group.
 
-  if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) {
     nsAutoCString name;
     request->GetName(name);
 
     uint32_t count = 0;
     if (mLoadGroup)
       mLoadGroup->GetActiveCount(&count);
 
     MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG,
@@ -464,17 +464,17 @@ nsDocLoader::OnStartRequest(nsIRequest *
 
 NS_IMETHODIMP
 nsDocLoader::OnStopRequest(nsIRequest *aRequest,
                            nsISupports *aCtxt,
                            nsresult aStatus)
 {
   nsresult rv = NS_OK;
 
-  if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) {
     nsAutoCString name;
     aRequest->GetName(name);
 
     uint32_t count = 0;
     if (mLoadGroup)
       mLoadGroup->GetActiveCount(&count);
 
     MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG,
--- a/uriloader/base/nsURILoader.cpp
+++ b/uriloader/base/nsURILoader.cpp
@@ -50,17 +50,17 @@
 #include "nsDocLoader.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Preferences.h"
 
 PRLogModuleInfo* nsURILoader::mLog = nullptr;
 
 #define LOG(args) MOZ_LOG(nsURILoader::mLog, PR_LOG_DEBUG, args)
 #define LOG_ERROR(args) MOZ_LOG(nsURILoader::mLog, PR_LOG_ERROR, args)
-#define LOG_ENABLED() PR_LOG_TEST(nsURILoader::mLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(nsURILoader::mLog, PR_LOG_DEBUG)
 
 #define NS_PREF_DISABLE_BACKGROUND_HANDLING \
     "security.exthelperapp.disable_background_handling"
 
 /**
  * The nsDocumentOpenInfo contains the state required when a single
  * document is being opened in order to discover the content type...
  * Each instance remains alive until its target URL has been loaded
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -124,17 +124,17 @@ enum {
 
 PRLogModuleInfo* nsExternalHelperAppService::mLog = nullptr;
 
 // Using level 3 here because the OSHelperAppServices use a log level
 // of PR_LOG_DEBUG (4), and we want less detailed output here
 // Using 3 instead of PR_LOG_WARN because we don't output warnings
 #undef LOG
 #define LOG(args) MOZ_LOG(nsExternalHelperAppService::mLog, 3, args)
-#define LOG_ENABLED() PR_LOG_TEST(nsExternalHelperAppService::mLog, 3)
+#define LOG_ENABLED() MOZ_LOG_TEST(nsExternalHelperAppService::mLog, 3)
 
 static const char NEVER_ASK_FOR_SAVE_TO_DISK_PREF[] =
   "browser.helperApps.neverAsk.saveToDisk";
 static const char NEVER_ASK_FOR_OPEN_FILE_PREF[] =
   "browser.helperApps.neverAsk.openFile";
 
 // Helper functions for Content-Disposition headers
 
--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
@@ -35,17 +35,17 @@
 #include "nsDirectoryServiceUtils.h"
 #include "prenv.h"      // for PR_GetEnv()
 #include "nsAutoPtr.h"
 #include "mozilla/Preferences.h"
 
 using namespace mozilla;
 
 #define LOG(args) MOZ_LOG(mLog, PR_LOG_DEBUG, args)
-#define LOG_ENABLED() PR_LOG_TEST(mLog, PR_LOG_DEBUG)
+#define LOG_ENABLED() MOZ_LOG_TEST(mLog, PR_LOG_DEBUG)
 
 static nsresult
 FindSemicolon(nsAString::const_iterator& aSemicolon_iter,
               const nsAString::const_iterator& aEnd_iter);
 static nsresult
 ParseMIMEType(const nsAString::const_iterator& aStart_iter,
               nsAString::const_iterator& aMajorTypeStart,
               nsAString::const_iterator& aMajorTypeEnd,
--- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp
@@ -46,17 +46,17 @@ using mozilla::dom::ContentChild;
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args)
 
 #undef LOG_ENABLED
-#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 namespace mozilla {
 namespace docshell {
 
 //-----------------------------------------------------------------------------
 // OfflineCacheUpdateChild::nsISupports
 //-----------------------------------------------------------------------------
 
--- a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp
@@ -24,17 +24,17 @@
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args)
 
 #undef LOG_ENABLED
-#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 namespace mozilla {
 namespace docshell {
 
 //-----------------------------------------------------------------------------
 // OfflineCacheUpdateGlue::nsISupports
 //-----------------------------------------------------------------------------
 
--- a/uriloader/prefetch/OfflineCacheUpdateParent.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateParent.cpp
@@ -27,17 +27,17 @@ using mozilla::dom::TabParent;
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args)
 
 #undef LOG_ENABLED
-#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 namespace mozilla {
 namespace docshell {
 
 //-----------------------------------------------------------------------------
 // OfflineCacheUpdateParent::nsISupports
 //-----------------------------------------------------------------------------
 
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -61,17 +61,17 @@ static const int32_t  kCustomProfileQuot
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args)
 
 #undef LOG_ENABLED
-#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 class AutoFreeArray {
 public:
     AutoFreeArray(uint32_t count, char **values)
         : mCount(count), mValues(values) {};
     ~AutoFreeArray() { NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mCount, mValues); }
 private:
     uint32_t mCount;
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -80,17 +80,17 @@ typedef mozilla::docshell::OfflineCacheU
 // the file offlineupdate.log
 //
 PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args)
 
 #undef LOG_ENABLED
-#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 namespace { // anon
 
 nsresult
 GetAppIDAndInBrowserFromWindow(nsIDOMWindow *aWindow,
                                uint32_t *aAppId,
                                bool *aInBrowser)
 {
--- a/uriloader/prefetch/nsPrefetchService.cpp
+++ b/uriloader/prefetch/nsPrefetchService.cpp
@@ -42,17 +42,17 @@ using namespace mozilla;
 // the file http.log
 //
 static PRLogModuleInfo *gPrefetchLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gPrefetchLog, 4, args)
 
 #undef LOG_ENABLED
-#define LOG_ENABLED() PR_LOG_TEST(gPrefetchLog, 4)
+#define LOG_ENABLED() MOZ_LOG_TEST(gPrefetchLog, 4)
 
 #define PREFETCH_PREF "network.prefetch-next"
 
 //-----------------------------------------------------------------------------
 // helpers
 //-----------------------------------------------------------------------------
 
 static inline uint32_t
--- a/widget/cocoa/NativeKeyBindings.mm
+++ b/widget/cocoa/NativeKeyBindings.mm
@@ -228,17 +228,17 @@ NativeKeyBindings::Execute(const WidgetK
     ("%p NativeKeyBindings::KeyPress, bindingCommands=%u",
      this, bindingCommands.Length()));
 
   nsAutoTArray<Command, 4> geckoCommands;
 
   for (uint32_t i = 0; i < bindingCommands.Length(); i++) {
     SEL selector = bindingCommands[i].selector;
 
-    if (PR_LOG_TEST(gNativeKeyBindingsLog, PR_LOG_ALWAYS)) {
+    if (MOZ_LOG_TEST(gNativeKeyBindingsLog, PR_LOG_ALWAYS)) {
       NSString* selectorString = NSStringFromSelector(selector);
       nsAutoString nsSelectorString;
       nsCocoaUtils::GetStringForNSString(selectorString, nsSelectorString);
 
       MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS,
         ("%p NativeKeyBindings::KeyPress, selector=%s",
          this, NS_LossyConvertUTF16toASCII(nsSelectorString).get()));
     }
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -1036,17 +1036,17 @@ TISInputSourceWrapper::InitKeyPressEvent
                                          WidgetKeyboardEvent& aKeyEvent,
                                          UInt32 aKbType)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   NS_ASSERTION(aKeyEvent.message == NS_KEY_PRESS,
                "aKeyEvent must be NS_KEY_PRESS event");
 
-  if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
+  if (MOZ_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     nsAutoString chars;
     nsCocoaUtils::GetStringForNSString([aNativeKeyEvent characters], chars);
     NS_ConvertUTF16toUTF8 utf8Chars(chars);
     char16_t expectedChar = static_cast<char16_t>(aInsertChar);
     NS_ConvertUTF16toUTF8 utf8ExpectedChar(&expectedChar, 1);
     MOZ_LOG(gLog, PR_LOG_ALWAYS,
       ("%p TISInputSourceWrapper::InitKeyPressEvent, aNativeKeyEvent=%p, "
        "[aNativeKeyEvent characters]=\"%s\", aInsertChar=0x%X(%s), "
@@ -1438,17 +1438,17 @@ TextInputHandler::CreateAllKeyboardLayou
   ::CFRelease(filter);
   return list;
 }
 
 // static
 void
 TextInputHandler::DebugPrintAllKeyboardLayouts()
 {
-  if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
+  if (MOZ_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     CFArrayRef list = CreateAllKeyboardLayoutList();
     MOZ_LOG(gLog, PR_LOG_ALWAYS, ("Keyboard layout configuration:"));
     CFIndex idx = ::CFArrayGetCount(list);
     TISInputSourceWrapper tis;
     for (CFIndex i = 0; i < idx; ++i) {
       TISInputSourceRef inputSource = static_cast<TISInputSourceRef>(
         const_cast<void *>(::CFArrayGetValueAtIndex(list, i)));
       tis.InitByTISInputSourceRef(inputSource);
@@ -2255,17 +2255,17 @@ IMEInputHandler::OnCurrentTextInputSourc
 {
   // Cache the latest IME opened mode to sLatestIMEOpenedModeInputSourceID.
   TISInputSourceWrapper tis;
   tis.InitByCurrentInputSource();
   if (tis.IsOpenedIMEMode()) {
     tis.GetInputSourceID(sLatestIMEOpenedModeInputSourceID);
   }
 
-  if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
+  if (MOZ_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     static CFStringRef sLastTIS = nullptr;
     CFStringRef newTIS;
     tis.GetInputSourceID(newTIS);
     if (!sLastTIS ||
         ::CFStringCompare(sLastTIS, newTIS, 0) != kCFCompareEqualTo) {
       TISInputSourceWrapper tis1, tis2, tis3, tis4, tis5;
       tis1.InitByCurrentKeyboardLayout();
       tis2.InitByCurrentASCIICapableInputSource();
@@ -2343,17 +2343,17 @@ IMEInputHandler::CreateAllIMEModeList()
   ::CFRelease(filter);
   return list;
 }
 
 // static
 void
 IMEInputHandler::DebugPrintAllIMEModes()
 {
-  if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
+  if (MOZ_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     CFArrayRef list = CreateAllIMEModeList();
     MOZ_LOG(gLog, PR_LOG_ALWAYS, ("IME mode configuration:"));
     CFIndex idx = ::CFArrayGetCount(list);
     TISInputSourceWrapper tis;
     for (CFIndex i = 0; i < idx; ++i) {
       TISInputSourceRef inputSource = static_cast<TISInputSourceRef>(
         const_cast<void *>(::CFArrayGetValueAtIndex(list, i)));
       tis.InitByTISInputSourceRef(inputSource);
@@ -3676,17 +3676,17 @@ IMEInputHandler::OpenSystemPreferredLang
     bool changed = false;
     CFStringRef lang = static_cast<CFStringRef>(
       ::CFLocaleGetValue(locale, kCFLocaleLanguageCode));
     NS_ASSERTION(lang, "lang is null");
     if (lang) {
       TISInputSourceWrapper tis;
       tis.InitByLanguage(lang);
       if (tis.IsOpenedIMEMode()) {
-        if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
+        if (MOZ_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
           CFStringRef foundTIS;
           tis.GetInputSourceID(foundTIS);
           MOZ_LOG(gLog, PR_LOG_ALWAYS,
             ("%p IMEInputHandler::OpenSystemPreferredLanguageIME, "
              "foundTIS=%s, lang=%s",
              this, GetCharacters(foundTIS), GetCharacters(lang)));
         }
         tis.Select();
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -2535,17 +2535,17 @@ KeyboardLayout::LoadLayout(HKL aLayout)
         }
         mVirtualKeys[vki].AttachDeadKeyTable(shiftState, dkt);
       }
     }
   }
 
   ::SetKeyboardState(originalKbdState);
 
-  if (PR_LOG_TEST(sKeyboardLayoutLogger, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(sKeyboardLayoutLogger, PR_LOG_DEBUG)) {
     static const UINT kExtendedScanCode[] = { 0x0000, 0xE000 };
     static const UINT kMapType =
       IsVistaOrLater() ? MAPVK_VSC_TO_VK_EX : MAPVK_VSC_TO_VK;
     MOZ_LOG(sKeyboardLayoutLogger, PR_LOG_DEBUG,
            ("Logging virtual keycode values for scancode (0x%p)...",
             mKeyboardLayout));
     for (uint32_t i = 0; i < ArrayLength(kExtendedScanCode); i++) {
       for (uint32_t j = 1; j <= 0xFF; j++) {
--- a/widget/windows/WinMouseScrollHandler.cpp
+++ b/widget/windows/WinMouseScrollHandler.cpp
@@ -31,17 +31,17 @@ PRLogModuleInfo* gMouseScrollLog = nullp
 
 static const char* GetBoolName(bool aBool)
 {
   return aBool ? "TRUE" : "FALSE";
 }
 
 static void LogKeyStateImpl()
 {
-  if (!PR_LOG_TEST(gMouseScrollLog, PR_LOG_DEBUG)) {
+  if (!MOZ_LOG_TEST(gMouseScrollLog, PR_LOG_DEBUG)) {
     return;
   }
   BYTE keyboardState[256];
   if (::GetKeyboardState(keyboardState)) {
     for (size_t i = 0; i < ArrayLength(keyboardState); i++) {
       if (keyboardState[i]) {
         MOZ_LOG(gMouseScrollLog, PR_LOG_DEBUG,
           ("    Current key state: keyboardState[0x%02X]=0x%02X (%s)",
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -2000,17 +2000,17 @@ nsTextStore::GetDisplayAttribute(ITfProp
                                  TF_DISPLAYATTRIBUTE* aResult)
 {
   NS_ENSURE_TRUE(aAttrProperty, E_FAIL);
   NS_ENSURE_TRUE(aRange, E_FAIL);
   NS_ENSURE_TRUE(aResult, E_FAIL);
 
   HRESULT hr;
 
-  if (PR_LOG_TEST(sTextStoreLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(sTextStoreLog, PR_LOG_DEBUG)) {
     LONG start = 0, length = 0;
     hr = GetRangeExtent(aRange, &start, &length);
     MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG,
            ("TSF: 0x%p   nsTextStore::GetDisplayAttribute(): "
             "GetDisplayAttribute range=%ld-%ld (hr=%s)",
             this, start - mComposition.mStart,
             start - mComposition.mStart + length,
             GetCommonReturnValueName(hr)));
@@ -3966,17 +3966,17 @@ nsTextStore::OnUpdateComposition(ITfComp
   hr = RecordCompositionUpdateAction();
   if (FAILED(hr)) {
     MOZ_LOG(sTextStoreLog, PR_LOG_ERROR,
            ("TSF: 0x%p   nsTextStore::OnUpdateComposition() FAILED due to "
             "RecordCompositionUpdateAction() failure", this));
     return hr;
   }
 
-  if (PR_LOG_TEST(sTextStoreLog, PR_LOG_ALWAYS)) {
+  if (MOZ_LOG_TEST(sTextStoreLog, PR_LOG_ALWAYS)) {
     Selection& currentSel = CurrentSelection();
     if (currentSel.IsDirty()) {
       MOZ_LOG(sTextStoreLog, PR_LOG_ERROR,
              ("TSF: 0x%p   nsTextStore::OnUpdateComposition() FAILED due to "
               "CurrentSelection() failure", this));
       return E_FAIL;
     }
     MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS,
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -1026,17 +1026,17 @@ nsComponentManagerImpl::FindFactory(cons
  * Returns an interface of type aIID off the singleton classobject.
  */
 NS_IMETHODIMP
 nsComponentManagerImpl::GetClassObject(const nsCID& aClass, const nsIID& aIID,
                                        void** aResult)
 {
   nsresult rv;
 
-  if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(nsComponentManagerLog, PR_LOG_DEBUG)) {
     char* buf = aClass.ToString();
     PR_LogPrint("nsComponentManager: GetClassObject(%s)", buf);
     if (buf) {
       free(buf);
     }
   }
 
   PR_ASSERT(aResult != nullptr);
@@ -1142,17 +1142,17 @@ nsComponentManagerImpl::CreateInstance(c
       NS_ERROR("Factory did not return an object but returned success!");
       rv = NS_ERROR_SERVICE_NOT_FOUND;
     }
   } else {
     // Translate error values
     rv = NS_ERROR_FACTORY_NOT_REGISTERED;
   }
 
-  if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) {
+  if (MOZ_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) {
     char* buf = aClass.ToString();
     MOZ_LOG(nsComponentManagerLog, PR_LOG_WARNING,
            ("nsComponentManager: CreateInstance(%s) %s", buf,
             NS_SUCCEEDED(rv) ? "succeeded" : "FAILED"));
     if (buf) {
       free(buf);
     }
   }
--- a/xpcom/components/nsNativeModuleLoader.cpp
+++ b/xpcom/components/nsNativeModuleLoader.cpp
@@ -198,17 +198,17 @@ nsNativeModuleLoader::ReleaserFunc(nsIHa
   aLoadData.mModule = nullptr;
   return PL_DHASH_NEXT;
 }
 
 PLDHashOperator
 nsNativeModuleLoader::UnloaderFunc(nsIHashable* aHashedFile,
                                    NativeLoadData& aLoadData, void*)
 {
-  if (PR_LOG_TEST(GetNativeModuleLoaderLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetNativeModuleLoaderLog(), PR_LOG_DEBUG)) {
     nsCOMPtr<nsIFile> file(do_QueryInterface(aHashedFile));
 
     nsAutoCString filePath;
     file->GetNativePath(filePath);
 
     LOG(PR_LOG_DEBUG,
         ("nsNativeModuleLoader::UnloaderFunc(\"%s\")", filePath.get()));
   }
--- a/xpcom/threads/TimerThread.cpp
+++ b/xpcom/threads/TimerThread.cpp
@@ -336,17 +336,17 @@ TimerThread::Run()
         }
         waitFor = PR_MicrosecondsToInterval(
           static_cast<uint32_t>(microseconds)); // Floor is accurate enough.
         if (waitFor == 0) {
           waitFor = 1;  // round up, wait the minimum time we can wait
         }
       }
 
-      if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
+      if (MOZ_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
         if (waitFor == PR_INTERVAL_NO_TIMEOUT)
           MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG,
                  ("waiting for PR_INTERVAL_NO_TIMEOUT\n"));
         else
           MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG,
                  ("waiting for %u\n", PR_IntervalToMilliseconds(waitFor)));
       }
     }
--- a/xpcom/threads/nsTimerImpl.cpp
+++ b/xpcom/threads/nsTimerImpl.cpp
@@ -308,17 +308,17 @@ nsTimerImpl::Startup()
   }
 
   return rv;
 }
 
 void
 nsTimerImpl::Shutdown()
 {
-  if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
     double mean = 0, stddev = 0;
     myNS_MeanAndStdDev(sDeltaNum, sDeltaSum, sDeltaSumSquared, &mean, &stddev);
 
     MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG,
            ("sDeltaNum = %f, sDeltaSum = %f, sDeltaSumSquared = %f\n",
             sDeltaNum, sDeltaSum, sDeltaSumSquared));
     MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG,
            ("mean: %fms, stddev: %fms\n", mean, stddev));
@@ -557,17 +557,17 @@ nsTimerImpl::Fire()
 #ifdef MOZ_TASK_TRACER
   // mTracedTask is an instance of FakeTracedTask created by
   // DispatchTracedTask(). AutoRunFakeTracedTask logs the begin/end time of the
   // timer/FakeTracedTask instance in ctor/dtor.
   mozilla::tasktracer::AutoRunFakeTracedTask runTracedTask(mTracedTask);
 #endif
 
   TimeStamp now = TimeStamp::Now();
-  if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
     TimeDuration   a = now - mStart; // actual delay in intervals
     TimeDuration   b = TimeDuration::FromMilliseconds(mDelay); // expected delay in intervals
     TimeDuration   delta = (a > b) ? a - b : b - a;
     uint32_t       d = delta.ToMilliseconds(); // delta in ms
     sDeltaSum += d;
     sDeltaSumSquared += double(d) * double(d);
     sDeltaNum++;
 
@@ -686,17 +686,17 @@ nsTimerEvent::DeleteAllocatorIfNeeded()
 
 NS_IMETHODIMP
 nsTimerEvent::Run()
 {
   if (mGeneration != mTimer->GetGeneration()) {
     return NS_OK;
   }
 
-  if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
     TimeStamp now = TimeStamp::Now();
     MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG,
            ("[this=%p] time between PostTimerEvent() and Fire(): %fms\n",
             this, (now - mInitTime).ToMilliseconds()));
   }
 
   mTimer->Fire();
   // Since nsTimerImpl is not thread-safe, we should release |mTimer|
@@ -727,17 +727,17 @@ nsTimerImpl::PostTimerEvent(already_AddR
 
   // Note: We override operator new for this class, and the override is
   // fallible!
   nsRefPtr<nsTimerEvent> event = new nsTimerEvent;
   if (!event) {
     return timer.forget();
   }
 
-  if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
     event->mInitTime = TimeStamp::Now();
   }
 
   // If this is a repeating precise timer, we need to calculate the time for
   // the next timer to fire before we make the callback.
   if (timer->IsRepeatingPrecisely()) {
     timer->SetDelayInternal(timer->mDelay);
 
@@ -774,17 +774,17 @@ nsTimerImpl::SetDelayInternal(uint32_t a
 
   TimeStamp now = TimeStamp::Now();
   if (mTimeout.IsNull() || mType != TYPE_REPEATING_PRECISE) {
     mTimeout = now;
   }
 
   mTimeout += delayInterval;
 
-  if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
+  if (MOZ_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
     if (mStart.IsNull()) {
       mStart = now;
     } else {
       mStart2 = now;
     }
   }
 }