Bug 1163194 - Part 1: Remove instances of #ifdef PR_LOGGING in dom/xul. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Mon, 11 May 2015 13:58:12 -0700
changeset 243404 49ac06aeb3a8c4b4d63ea0c7d9e2c29e04524313
parent 243403 b8498d290c8a283cf78ab869a2b3390283ec9f86
child 243405 3026a0345003b62c61371988cb92e48d536ba8f1
push id28738
push usercbook@mozilla.com
push dateTue, 12 May 2015 14:11:31 +0000
treeherdermozilla-central@bedce1b405a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1163194
milestone40.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 1163194 - Part 1: Remove instances of #ifdef PR_LOGGING in dom/xul. r=froydnj PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
dom/xul/XULDocument.cpp
dom/xul/nsXULCommandDispatcher.cpp
dom/xul/nsXULContentSink.cpp
dom/xul/templates/nsContentTestNode.cpp
dom/xul/templates/nsInstantiationNode.cpp
dom/xul/templates/nsRDFConInstanceTestNode.cpp
dom/xul/templates/nsRDFConMemberTestNode.cpp
dom/xul/templates/nsRDFPropertyTestNode.cpp
dom/xul/templates/nsRuleNetwork.cpp
dom/xul/templates/nsXULContentBuilder.cpp
dom/xul/templates/nsXULContentUtils.cpp
dom/xul/templates/nsXULTemplateBuilder.cpp
dom/xul/templates/nsXULTemplateBuilder.h
dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
dom/xul/templates/nsXULTemplateQueryProcessorRDF.h
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -370,31 +370,29 @@ 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)
 {
-#ifdef PR_LOGGING
     if (PR_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)) {
                 PR_LOG(gXULLog, PR_LOG_WARNING,
                        ("xul: load document '%s'", urlspec.get()));
             }
         }
     }
-#endif
     // NOTE: If this ever starts calling nsDocument::StartDocumentLoad
     // we'll possibly need to reset our content type afterwards.
     mStillWalking = true;
     mMayStartLayout = false;
     mDocumentLoadGroup = do_GetWeakReference(aLoadGroup);
 
     mChannel = aChannel;
 
@@ -556,26 +554,24 @@ 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);
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) {
         nsAutoCString urlspec;
         rv = uri->GetSpec(urlspec);
         if (NS_SUCCEEDED(rv)) {
             PR_LOG(gXULLog, PR_LOG_WARNING,
                    ("xul: Finished loading document '%s'", urlspec.get()));
         }
     }
-#endif
 }
 
 NS_IMETHODIMP
 XULDocument::OnPrototypeLoadDone(bool aResumeWalk)
 {
     nsresult rv;
 
     // Add the style overlays from chrome registry, if any.
@@ -1888,20 +1884,18 @@ XULDocument::Init()
           NS_ERROR("Could not instantiate nsXULPrototypeCache");
           return NS_ERROR_FAILURE;
         }
     }
 
     Preferences::RegisterCallback(XULDocument::DirectionChanged,
                                   "intl.uidirection.", this);
 
-#ifdef PR_LOGGING
     if (! gXULLog)
         gXULLog = PR_NewLogModule("XULDocument");
-#endif
 
     return NS_OK;
 }
 
 
 nsresult
 XULDocument::StartLayout(void)
 {
@@ -2272,28 +2266,26 @@ 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) {
-#ifdef PR_LOGGING
         if (PR_LOG_TEST(gXULLog, PR_LOG_ERROR)) {
             nsCOMPtr<nsIURI> url = mCurrentPrototype->GetURI();
 
             nsAutoCString urlspec;
             rv = url->GetSpec(urlspec);
             if (NS_FAILED(rv)) return rv;
 
             PR_LOG(gXULLog, PR_LOG_ERROR,
                    ("xul: error parsing '%s'", urlspec.get()));
         }
-#endif
 
         return NS_OK;
     }
 
     uint32_t piInsertionPoint = 0;
     if (mState != eState_Master) {
         int32_t indexOfRoot = IndexOf(GetRootElement());
         NS_ASSERTION(indexOfRoot >= 0,
@@ -2545,32 +2537,30 @@ XULDocument::LoadOverlayInternal(nsIURI*
                                  bool* aShouldReturn,
                                  bool* aFailureFromContent)
 {
     nsresult rv;
 
     *aShouldReturn = false;
     *aFailureFromContent = false;
 
-#ifdef PR_LOGGING
     if (PR_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()))
             parentDoc = "";
 
         PR_LOG(gXULLog, PR_LOG_DEBUG,
                 ("xul: %s loading overlay %s", parentDoc.get(), urlspec.get()));
     }
-#endif
 
     if (aIsDynamic)
         mResolutionPhase = nsForwardReference::eStart;
 
     // Chrome documents are allowed to load overlays from anywhere.
     // In all other cases, the overlay is only allowed to load if
     // the master document and prototype document have the same origin.
 
@@ -3581,23 +3571,21 @@ 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;
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
         PR_LOG(gXULLog, PR_LOG_NOTICE,
                ("xul: creating <%s> from prototype",
                 NS_ConvertUTF16toUTF8(aPrototype->mNodeInfo->QualifiedName()).get()));
     }
-#endif
 
     nsRefPtr<Element> result;
 
     if (aPrototype->mNodeInfo->NamespaceEquals(kNameSpaceID_XUL)) {
         // If it's a XUL element, it'll be lightweight until somebody
         // monkeys with it.
         rv = nsXULElement::Create(aPrototype, this, true, aIsRoot, getter_AddRefs(result));
         if (NS_FAILED(rv)) return rv;
@@ -3853,25 +3841,23 @@ 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;
     }
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
         nsAutoCString idC;
         idC.AssignWithConversion(id);
         PR_LOG(gXULLog, PR_LOG_NOTICE,
                ("xul: overlay resolved '%s'",
                 idC.get()));
     }
-#endif
 
     mResolved = true;
     return eResolve_Succeeded;
 }
 
 
 
 nsresult
@@ -4024,17 +4010,16 @@ XULDocument::OverlayForwardReference::Me
 
     return NS_OK;
 }
 
 
 
 XULDocument::OverlayForwardReference::~OverlayForwardReference()
 {
-#ifdef PR_LOGGING
     if (PR_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();
@@ -4045,17 +4030,16 @@ XULDocument::OverlayForwardReference::~O
         nsAutoCString parentDoc;
         nsresult rv = mDocument->mChannel->GetOriginalURI(getter_AddRefs(docURI));
         if (NS_SUCCEEDED(rv))
             docURI->GetSpec(parentDoc);
         PR_LOG(gXULLog, PR_LOG_WARNING,
                ("xul: %s overlay failed to resolve '%s' in %s",
                 urlspec.get(), idC.get(), parentDoc.get()));
     }
-#endif
 }
 
 
 //----------------------------------------------------------------------
 //
 // XULDocument::BroadcasterHookup
 //
 
@@ -4069,17 +4053,16 @@ XULDocument::BroadcasterHookup::Resolve(
     if (NS_FAILED(rv)) return eResolve_Error;
 
     return mResolved ? eResolve_Succeeded : eResolve_Later;
 }
 
 
 XULDocument::BroadcasterHookup::~BroadcasterHookup()
 {
-#ifdef PR_LOGGING
     if (PR_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);
@@ -4094,17 +4077,16 @@ XULDocument::BroadcasterHookup::~Broadca
         attributeC.AssignWithConversion(attribute);
         broadcasteridC.AssignWithConversion(broadcasterID);
         PR_LOG(gXULLog, PR_LOG_WARNING,
                ("xul: broadcaster hookup failed <%s attribute='%s'> to %s",
                 nsAtomCString(mObservesElement->NodeInfo()->NameAtom()).get(),
                 attributeC.get(),
                 broadcasteridC.get()));
     }
-#endif
 }
 
 
 //----------------------------------------------------------------------
 //
 // XULDocument::TemplateBuilderHookup
 //
 
@@ -4289,17 +4271,16 @@ XULDocument::CheckBroadcasterHookup(Elem
 
     NS_ENSURE_ARG(broadcaster && listener);
     ErrorResult domRv;
     AddBroadcastListenerFor(*broadcaster, *listener, attribute, domRv);
     if (domRv.Failed()) {
         return domRv.StealNSResult();
     }
 
-#ifdef PR_LOGGING
     // Tell the world we succeeded
     if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
         nsCOMPtr<nsIContent> content =
             do_QueryInterface(listener);
 
         NS_ASSERTION(content != nullptr, "not an nsIContent");
         if (! content)
             return rv;
@@ -4308,17 +4289,16 @@ XULDocument::CheckBroadcasterHookup(Elem
         attributeC.AssignWithConversion(attribute);
         broadcasteridC.AssignWithConversion(broadcasterID);
         PR_LOG(gXULLog, PR_LOG_NOTICE,
                ("xul: broadcaster hookup <%s attribute='%s'> to %s",
                 nsAtomCString(content->NodeInfo()->NameAtom()).get(),
                 attributeC.get(),
                 broadcasteridC.get()));
     }
-#endif
 
     *aNeedsHookup = false;
     *aDidResolve = true;
     return NS_OK;
 }
 
 nsresult
 XULDocument::InsertElement(nsINode* aParent, nsIContent* aChild,
--- a/dom/xul/nsXULCommandDispatcher.cpp
+++ b/dom/xul/nsXULCommandDispatcher.cpp
@@ -32,30 +32,26 @@
 #include "nsError.h"
 #include "nsDOMClassInfoID.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo* gCommandLog;
-#endif
 
 ////////////////////////////////////////////////////////////////////////
 
 nsXULCommandDispatcher::nsXULCommandDispatcher(nsIDocument* aDocument)
     : mDocument(aDocument), mUpdaters(nullptr)
 {
 
-#ifdef PR_LOGGING
   if (! gCommandLog)
     gCommandLog = PR_NewLogModule("nsXULCommandDispatcher");
-#endif
 }
 
 nsXULCommandDispatcher::~nsXULCommandDispatcher()
 {
   Disconnect();
 }
 
 // QueryInterface implementation for nsXULCommandDispatcher
--- a/dom/xul/nsXULContentSink.cpp
+++ b/dom/xul/nsXULContentSink.cpp
@@ -52,19 +52,17 @@
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
 #include "nsAttrName.h"
 #include "nsXMLContentSink.h"
 #include "nsIConsoleService.h"
 #include "nsIScriptError.h"
 #include "nsContentTypeParser.h"
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo* gContentSinkLog;
-#endif
 
 //----------------------------------------------------------------------
 
 XULContentSinkImpl::ContextStack::ContextStack()
     : mTop(nullptr), mDepth(0)
 {
 }
 
@@ -160,20 +158,18 @@ XULContentSinkImpl::ContextStack::Traver
 XULContentSinkImpl::XULContentSinkImpl()
     : mText(nullptr),
       mTextLength(0),
       mTextSize(0),
       mConstrainSize(true),
       mState(eInProlog)
 {
 
-#ifdef PR_LOGGING
     if (! gContentSinkLog)
         gContentSinkLog = PR_NewLogModule("nsXULContentSink");
-#endif
 }
 
 
 XULContentSinkImpl::~XULContentSinkImpl()
 {
     // The context stack _should_ be empty, unless something has gone wrong.
     NS_ASSERTION(mContextStack.Depth() == 0, "Context stack not empty?");
     mContextStack.Clear();
@@ -738,26 +734,24 @@ XULContentSinkImpl::OpenRoot(const char1
         return NS_ERROR_UNEXPECTED;
     }
 
     // Create the element
     nsXULPrototypeElement* element;
     rv = CreateElement(aNodeInfo, &element);
 
     if (NS_FAILED(rv)) {
-#ifdef PR_LOGGING
         if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
             nsAutoString anodeC;
             aNodeInfo->GetName(anodeC);
             PR_LOG(gContentSinkLog, PR_LOG_ERROR,
                    ("xul: unable to create element '%s' at line %d",
                     NS_ConvertUTF16toUTF8(anodeC).get(),
                     -1)); // XXX pass in line number
         }
-#endif
 
         return rv;
     }
 
     // Push the element onto the context stack, so that child
     // containers will hook up to us as their parent.
     rv = mContextStack.Push(element, mState);
     if (NS_FAILED(rv)) {
@@ -781,26 +775,24 @@ XULContentSinkImpl::OpenTag(const char16
 {
     nsresult rv;
 
     // Create the element
     nsXULPrototypeElement* element;
     rv = CreateElement(aNodeInfo, &element);
 
     if (NS_FAILED(rv)) {
-#ifdef PR_LOGGING
         if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
             nsAutoString anodeC;
             aNodeInfo->GetName(anodeC);
             PR_LOG(gContentSinkLog, PR_LOG_ERROR,
                    ("xul: unable to create element '%s' at line %d",
                     NS_ConvertUTF16toUTF8(anodeC).get(),
                     aLineNumber));
         }
-#endif
 
         return rv;
     }
 
     // Link this element to its parent.
     nsPrototypeArray* children = nullptr;
     rv = mContextStack.GetTopChildren(&children);
     if (NS_FAILED(rv)) {
@@ -980,33 +972,31 @@ 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);
 
-#ifdef PR_LOGGING
       if (PR_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]);
           PR_LOG(gContentSinkLog, PR_LOG_DEBUG,
                  ("xul: %.5d. %s    %s=%s",
                   -1, // XXX pass in line number
                   NS_ConvertUTF16toUTF8(extraWhiteSpace).get(),
                   NS_ConvertUTF16toUTF8(qnameC).get(),
                   NS_ConvertUTF16toUTF8(valueC).get()));
       }
-#endif
   }
 
   return NS_OK;
 }
 
 nsresult
 XULContentSinkImpl::AddText(const char16_t* aText,
                             int32_t aLength)
--- a/dom/xul/templates/nsContentTestNode.cpp
+++ b/dom/xul/templates/nsContentTestNode.cpp
@@ -8,44 +8,40 @@
 #include "nsIAtom.h"
 #include "nsIDOMElement.h"
 #include "nsXULContentUtils.h"
 #include "nsIXULTemplateResult.h"
 #include "nsIXULTemplateBuilder.h"
 #include "nsXULTemplateQueryProcessorRDF.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
-#endif
 
 nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
                                      nsIAtom* aRefVariable)
     : TestNode(nullptr),
       mProcessor(aProcessor),
       mDocument(nullptr),
       mRefVariable(aRefVariable),
       mTag(nullptr)
 {
-#ifdef PR_LOGGING
     if (PR_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);
 
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsContentTestNode[%p]: ref-var=%s tag=%s",
                 this, NS_ConvertUTF16toUTF8(refvar).get(),
                 NS_ConvertUTF16toUTF8(tag).get()));
     }
-#endif
 }
 
 nsresult
 nsContentTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
                                         bool* aCantHandleYet) const
 
 {
     if (aCantHandleYet)
--- a/dom/xul/templates/nsInstantiationNode.cpp
+++ b/dom/xul/templates/nsInstantiationNode.cpp
@@ -3,29 +3,25 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsInstantiationNode.h"
 #include "nsTemplateRule.h"
 #include "nsXULTemplateQueryProcessorRDF.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
-#endif
 
 nsInstantiationNode::nsInstantiationNode(nsXULTemplateQueryProcessorRDF* aProcessor,
                                          nsRDFQuery* aQuery)
         : mProcessor(aProcessor),
           mQuery(aQuery)
 {
-#ifdef PR_LOGGING
     PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
            ("nsInstantiationNode[%p] query=%p", this, aQuery));
-#endif
 
     MOZ_COUNT_CTOR(nsInstantiationNode);
 }
 
 
 nsInstantiationNode::~nsInstantiationNode()
 {
     MOZ_COUNT_DTOR(nsInstantiationNode);
--- a/dom/xul/templates/nsRDFConInstanceTestNode.cpp
+++ b/dom/xul/templates/nsRDFConInstanceTestNode.cpp
@@ -7,43 +7,40 @@
 #include "nsIRDFContainer.h"
 #include "nsIRDFContainerUtils.h"
 #include "nsIServiceManager.h"
 #include "nsRDFCID.h"
 #include "nsRDFConInstanceTestNode.h"
 #include "nsResourceSet.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 #include "nsXULContentUtils.h"
 extern PRLogModuleInfo* gXULTemplateLog;
 
 static const char*
 TestToString(nsRDFConInstanceTestNode::Test aTest) {
     switch (aTest) {
     case nsRDFConInstanceTestNode::eFalse:    return "false";
     case nsRDFConInstanceTestNode::eTrue:     return "true";
     case nsRDFConInstanceTestNode::eDontCare: return "dontcare";
     }
     return "?";
 }
-#endif
 
 nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent,
                                                    nsXULTemplateQueryProcessorRDF* aProcessor,
                                                    nsIAtom* aContainerVariable,
                                                    Test aContainer,
                                                    Test aEmpty)
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mContainerVariable(aContainerVariable),
       mContainer(aContainer),
       mEmpty(aEmpty)
 {
-#ifdef PR_LOGGING
     if (PR_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;
 
@@ -65,17 +62,16 @@ nsRDFConInstanceTestNode::nsRDFConInstan
                ("nsRDFConInstanceTestNode[%p]: parent=%p member-props=(%s) container-var=%s container=%s empty=%s",
                 this,
                 aParent,
                 props.get(),
                 NS_ConvertUTF16toUTF8(cvar).get(),
                 TestToString(aContainer),
                 TestToString(aEmpty)));
     }
-#endif
 }
 
 nsresult
 nsRDFConInstanceTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
                                                bool* aCantHandleYet) const
 {
     nsresult rv;
 
@@ -99,26 +95,24 @@ nsRDFConInstanceTestNode::FilterInstanti
         }
 
         nsCOMPtr<nsIRDFResource> valueres = do_QueryInterface(value);
         if (! valueres) {
             aInstantiations.Erase(inst--);
             continue;
         }
 
-#ifdef PR_LOGGING
         if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             const char* container = "(unbound)";
             valueres->GetValueConst(&container);
 
             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("nsRDFConInstanceTestNode[%p]::FilterInstantiations() container=[%s]",
                     this, container));
         }
-#endif
 
         nsCOMPtr<nsIRDFContainer> rdfcontainer;
 
         bool isRDFContainer;
         rv = rdfc->IsContainer(ds, valueres, &isRDFContainer);
         if (NS_FAILED(rv)) return rv;
 
         if (mEmpty != eDontCare || mContainer != eDontCare) {
@@ -246,33 +240,31 @@ 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);
     }
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source;
         aSource->GetValueConst(&source);
 
         const char* property;
         aProperty->GetValueConst(&property);
 
         nsAutoString target;
         nsXULContentUtils::GetTextForNode(aTarget, target);
 
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsRDFConInstanceTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s",
                 this, source, property, NS_ConvertUTF16toUTF8(target).get(),
                 canpropagate ? "true" : "false"));
     }
-#endif
 
     if (canpropagate) {
         aInitialBindings.AddAssignment(mContainerVariable, aSource);
         return true;
     }
 
     return false;
 }
--- a/dom/xul/templates/nsRDFConMemberTestNode.cpp
+++ b/dom/xul/templates/nsRDFConMemberTestNode.cpp
@@ -8,30 +8,27 @@
 #include "nsIRDFContainerUtils.h"
 #include "nsRDFCID.h"
 #include "nsIServiceManager.h"
 #include "nsResourceSet.h"
 #include "nsString.h"
 #include "nsXULContentUtils.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
-#endif
 
 nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent,
                                                nsXULTemplateQueryProcessorRDF* aProcessor,
                                                nsIAtom *aContainerVariable,
                                                nsIAtom *aMemberVariable)
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mContainerVariable(aContainerVariable),
       mMemberVariable(aMemberVariable)
 {
-#ifdef PR_LOGGING
     if (PR_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;
 
@@ -56,17 +53,16 @@ nsRDFConMemberTestNode::nsRDFConMemberTe
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsRDFConMemberTestNode[%p]: parent=%p member-props=(%s) container-var=%s member-var=%s",
                 this,
                 aParent,
                 props.get(),
                 NS_ConvertUTF16toUTF8(cvar).get(),
                 NS_ConvertUTF16toUTF8(mvar).get()));
     }
-#endif
 }
 
 nsresult
 nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
                                              bool* aCantHandleYet) const
 {
     // XXX Uh, factor me, please!
     nsresult rv;
@@ -110,31 +106,29 @@ nsRDFConMemberTestNode::FilterInstantiat
             }
         }
 
         bool hasMemberBinding;
         nsCOMPtr<nsIRDFNode> memberValue;
         hasMemberBinding = inst->mAssignments.GetAssignmentFor(mMemberVariable,
                                                                getter_AddRefs(memberValue));
 
-#ifdef PR_LOGGING
         if (PR_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);
 
             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("nsRDFConMemberTestNode[%p]: FilterInstantiations() container=[%s] member=[%s]",
                     this, container, NS_ConvertUTF16toUTF8(member).get()));
         }
-#endif
 
         if (hasContainerBinding && hasMemberBinding) {
             // it's a consistency check. see if we have a assignment that is consistent
             bool isconsistent = false;
 
             if (rdfcontainer) {
                 // RDF containers are easy. Just use the container API.
                 int32_t index;
@@ -216,25 +210,23 @@ 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;
 
-#ifdef PR_LOGGING
                 if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                     nsAutoString member;
                     nsXULContentUtils::GetTextForNode(node, member);
 
                     PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                            ("    member => %s", NS_ConvertUTF16toUTF8(member).get()));
                 }
-#endif
 
                 Instantiation newinst = *inst;
                 newinst.AddAssignment(mMemberVariable, node);
 
                 Element* element =
                     new nsRDFConMemberTestNode::Element(containerRes, node);
 
                 if (! element)
@@ -305,25 +297,23 @@ 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;
 
-#ifdef PR_LOGGING
                         if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                             const char* container;
                             source->GetValueConst(&container);
 
                             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                    ("    container => %s", container));
                         }
-#endif
 
                         // Add a new instantiation
                         Instantiation newinst = *inst;
                         newinst.AddAssignment(mContainerVariable, source);
 
                         Element* element =
                             new nsRDFConMemberTestNode::Element(source,
                                                                 memberValue);
@@ -377,44 +367,40 @@ nsRDFConMemberTestNode::FilterInstantiat
 
                     if (hasContainerBinding) {
                         variable = mMemberVariable;
 
                         value = do_QueryInterface(isupports);
                         NS_ASSERTION(value != nullptr, "member is not an nsIRDFNode");
                         if (! value) continue;
 
-#ifdef PR_LOGGING
                         if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                             nsAutoString s;
                             nsXULContentUtils::GetTextForNode(value, s);
 
                             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                    ("    member => %s", NS_ConvertUTF16toUTF8(s).get()));
                         }
-#endif
                     }
                     else {
                         variable = mContainerVariable;
 
                         valueRes = do_QueryInterface(isupports);
                         NS_ASSERTION(valueRes != nullptr, "container is not an nsIRDFResource");
                         if (! valueRes) continue;
 
                         value = valueRes;
 
-#ifdef PR_LOGGING
                         if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                             const char* s;
                             valueRes->GetValueConst(&s);
 
                             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                    ("    container => %s", s));
                         }
-#endif
                     }
 
                     // Copy the original instantiation, and add it to the
                     // instantiation set with the new assignment that we've
                     // introduced. Ownership will be transferred to the
                     Instantiation newinst = *inst;
                     newinst.AddAssignment(variable, value);
 
@@ -475,33 +461,31 @@ 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);
     }
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source;
         aSource->GetValueConst(&source);
 
         const char* property;
         aProperty->GetValueConst(&property);
 
         nsAutoString target;
         nsXULContentUtils::GetTextForNode(aTarget, target);
 
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsRDFConMemberTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s",
                 this, source, property, NS_ConvertUTF16toUTF8(target).get(),
                 canpropagate ? "true" : "false"));
     }
-#endif
 
     if (canpropagate) {
         aInitialBindings.AddAssignment(mContainerVariable, aSource);
         aInitialBindings.AddAssignment(mMemberVariable, aTarget);
         return true;
     }
 
     return false;
--- a/dom/xul/templates/nsRDFPropertyTestNode.cpp
+++ b/dom/xul/templates/nsRDFPropertyTestNode.cpp
@@ -3,35 +3,32 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsRDFPropertyTestNode.h"
 #include "nsString.h"
 #include "nsXULContentUtils.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
 #include "nsIRDFLiteral.h"
-#endif
 
 nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
                                              nsXULTemplateQueryProcessorRDF* aProcessor,
                                              nsIAtom* aSourceVariable,
                                              nsIRDFResource* aProperty,
                                              nsIAtom* aTargetVariable)
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mSourceVariable(aSourceVariable),
       mSource(nullptr),
       mProperty(aProperty),
       mTargetVariable(aTargetVariable),
       mTarget(nullptr)
 {
-#ifdef PR_LOGGING
     if (PR_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);
@@ -39,34 +36,32 @@ nsRDFPropertyTestNode::nsRDFPropertyTest
         nsAutoString tvar(NS_LITERAL_STRING("(none)"));
         if (mTargetVariable)
             mTargetVariable->ToString(tvar);
 
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
                 this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(tvar).get()));
     }
-#endif
 }
 
 
 nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
                                              nsXULTemplateQueryProcessorRDF* aProcessor,
                                              nsIRDFResource* aSource,
                                              nsIRDFResource* aProperty,
                                              nsIAtom* aTargetVariable)
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mSourceVariable(0),
       mSource(aSource),
       mProperty(aProperty),
       mTargetVariable(aTargetVariable),
       mTarget(nullptr)
 {
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source = "(null)";
         if (aSource)
             aSource->GetValueConst(&source);
 
         const char* prop = "(null)";
         if (aProperty)
             aProperty->GetValueConst(&prop);
@@ -74,51 +69,48 @@ nsRDFPropertyTestNode::nsRDFPropertyTest
         nsAutoString tvar(NS_LITERAL_STRING("(none)"));
         if (mTargetVariable)
             mTargetVariable->ToString(tvar);
 
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
                 this, aParent, source, prop, NS_ConvertUTF16toUTF8(tvar).get()));
     }
-#endif
 }
 
 
 nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
                                              nsXULTemplateQueryProcessorRDF* aProcessor,
                                              nsIAtom* aSourceVariable,
                                              nsIRDFResource* aProperty,
                                              nsIRDFNode* aTarget)
     : nsRDFTestNode(aParent),
       mProcessor(aProcessor),
       mSourceVariable(aSourceVariable),
       mSource(nullptr),
       mProperty(aProperty),
       mTargetVariable(0),
       mTarget(aTarget)
 {
-#ifdef PR_LOGGING
     if (PR_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);
 
         nsAutoString target;
         nsXULContentUtils::GetTextForNode(aTarget, target);
 
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
                 this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(target).get()));
     }
-#endif
 }
 
 
 nsresult
 nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
                                             bool* aCantHandleYet) const
 {
     nsresult rv;
@@ -151,43 +143,39 @@ nsRDFPropertyTestNode::FilterInstantiati
             hasTargetBinding = true;
             targetValue = mTarget;
         }
         else {
             hasTargetBinding = inst->mAssignments.GetAssignmentFor(mTargetVariable,
                                                                    getter_AddRefs(targetValue));
         }
 
-#ifdef PR_LOGGING
         if (PR_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);
 
             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("nsRDFPropertyTestNode[%p]: FilterInstantiations() source=[%s] target=[%s]",
                     this, source, NS_ConvertUTF16toUTF8(target).get()));
         }
-#endif
 
         if (hasSourceBinding && hasTargetBinding) {
             // it's a consistency check. see if we have a assignment that is consistent
             bool hasAssertion;
             rv = ds->HasAssertion(sourceRes, mProperty, targetValue,
                                   true, &hasAssertion);
             if (NS_FAILED(rv)) return rv;
 
-#ifdef PR_LOGGING
             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("    consistency check => %s", hasAssertion ? "passed" : "failed"));
-#endif
 
             if (hasAssertion) {
                 // it's consistent.
                 Element* element =
                     new nsRDFPropertyTestNode::Element(sourceRes, mProperty,
                                                        targetValue);
 
                 if (! element)
@@ -236,47 +224,43 @@ nsRDFPropertyTestNode::FilterInstantiati
                 nsCOMPtr<nsIRDFNode> value;
 
                 if (hasSourceBinding) {
                     variable = mTargetVariable;
 
                     value = do_QueryInterface(isupports);
                     NS_ASSERTION(value != nullptr, "target is not an nsIRDFNode");
 
-#ifdef PR_LOGGING
                     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                         nsAutoString s(NS_LITERAL_STRING("(none found)"));
                         if (value)
                             nsXULContentUtils::GetTextForNode(value, s);
 
                         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                ("    target => %s", NS_ConvertUTF16toUTF8(s).get()));
                     }
-#endif
 
                     if (! value) continue;
 
                     targetValue = value;
                 }
                 else {
                     variable = mSourceVariable;
 
                     nsCOMPtr<nsIRDFResource> source = do_QueryInterface(isupports);
                     NS_ASSERTION(source != nullptr, "source is not an nsIRDFResource");
 
-#ifdef PR_LOGGING
                     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                         const char* s = "(none found)";
                         if (source)
                             source->GetValueConst(&s);
 
                         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                                ("    source => %s", s));
                     }
-#endif
 
                     if (! source) continue;
 
                     value = sourceRes = source;
                 }
 
                 // Copy the original instantiation, and add it to the
                 // instantiation set with the new assignment that we've
@@ -332,56 +316,52 @@ nsRDFPropertyTestNode::CanPropagate(nsIR
             aInitialBindings.AddAssignment(mSourceVariable, aSource);
 
         if (mTargetVariable)
             aInitialBindings.AddAssignment(mTargetVariable, aTarget);
 
         result = true;
     }
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* source;
         aSource->GetValueConst(&source);
 
         const char* property;
         aProperty->GetValueConst(&property);
 
         nsAutoString target;
         nsXULContentUtils::GetTextForNode(aTarget, target);
 
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("nsRDFPropertyTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s",
                 this, source, property, NS_ConvertUTF16toUTF8(target).get(),
                 result ? "true" : "false"));
     }
-#endif
 
     return result;
 }
 
 void
 nsRDFPropertyTestNode::Retract(nsIRDFResource* aSource,
                                nsIRDFResource* aProperty,
                                nsIRDFNode* aTarget) const
 {
     if (aProperty == mProperty.get()) {
-#ifdef PR_LOGGING
         if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             const char* source;
             aSource->GetValueConst(&source);
 
             const char* property;
             aProperty->GetValueConst(&property);
 
             nsAutoString target;
             nsXULContentUtils::GetTextForNode(aTarget, target);
 
             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("nsRDFPropertyTestNode[%p]: Retract([%s]==[%s]=>[%s])",
                     this, source, property, NS_ConvertUTF16toUTF8(target).get()));
         }
-#endif
 
         mProcessor->RetractElement(Element(aSource, aProperty, aTarget));
     }
 }
 
--- a/dom/xul/templates/nsRuleNetwork.cpp
+++ b/dom/xul/templates/nsRuleNetwork.cpp
@@ -16,25 +16,22 @@
 
  */
 
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "plhash.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
 
 #include "nsString.h"
 #include "nsUnicharUtils.h"
 #include "nsXULContentUtils.h"
 
-#endif
-
 #include "nsRuleNetwork.h"
 #include "nsXULTemplateResultSetRDF.h"
 #include "nsRDFConMemberTestNode.h"
 #include "nsRDFPropertyTestNode.h"
 
 using namespace mozilla;
 
 //----------------------------------------------------------------------
--- a/dom/xul/templates/nsXULContentBuilder.cpp
+++ b/dom/xul/templates/nsXULContentBuilder.cpp
@@ -441,32 +441,30 @@ 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;
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("nsXULContentBuilder::BuildContentFromTemplate (is unique: %d)",
                aIsUnique));
 
         nsAutoString id;
         aChild->GetId(id);
 
         PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("Tags: [Template: %s  Resource: %s  Real: %s] for id %s",
                 nsAtomCString(aTemplateNode->NodeInfo()->NameAtom()).get(),
                 nsAtomCString(aResourceNode->NodeInfo()->NameAtom()).get(),
                 nsAtomCString(aRealNode->NodeInfo()->NameAtom()).get(), NS_ConvertUTF16toUTF8(id).get()));
     }
-#endif
 
     // Iterate through all of the template children, constructing
     // "real" content model nodes for each "template" child.
     for (nsIContent* tmplKid = aTemplateNode->GetFirstChild();
          tmplKid;
          tmplKid = tmplKid->GetNextSibling()) {
 
         int32_t nameSpaceID = tmplKid->GetNameSpaceID();
@@ -520,25 +518,23 @@ nsXULContentBuilder::BuildContentFromTem
             isGenerationElement = true;
             isUnique = false;
         }
 
         MOZ_ASSERT_IF(isGenerationElement, tmplKid->IsElement());
 
         nsIAtom *tag = tmplKid->NodeInfo()->NameAtom();
 
-#ifdef PR_LOGGING
         if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
             PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                    ("xultemplate[%p]     building %s %s %s",
                     this, nsAtomCString(tag).get(),
                     (isGenerationElement ? "[resource]" : ""),
                     (isUnique ? "[unique]" : "")));
         }
-#endif
 
         // Set to true if the child we're trying to create now
         // already existed in the content model.
         bool realKidAlreadyExisted = false;
 
         nsCOMPtr<nsIContent> realKid;
         if (isUnique) {
             // The content is "unique"; that is, we haven't descended
@@ -1072,25 +1068,23 @@ nsXULContentBuilder::CreateContainerCont
 nsresult
 nsXULContentBuilder::CreateContainerContentsForQuerySet(nsIContent* aElement,
                                                         nsIXULTemplateResult* aResult,
                                                         bool aNotify,
                                                         nsTemplateQuerySet* aQuerySet,
                                                         nsIContent** aContainer,
                                                         int32_t* aNewIndexInContainer)
 {
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsAutoString id;
         aResult->GetId(id);
         PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("nsXULContentBuilder::CreateContainerContentsForQuerySet start for ref %s\n",
                NS_ConvertUTF16toUTF8(id).get()));
     }
-#endif
 
     if (! mQueryProcessor)
         return NS_OK;
 
     nsCOMPtr<nsISimpleEnumerator> results;
     nsresult rv = mQueryProcessor->GenerateResults(mDataSource, aResult,
                                                    aQuerySet->mCompiledQuery,
                                                    getter_AddRefs(results));
--- a/dom/xul/templates/nsXULContentUtils.cpp
+++ b/dom/xul/templates/nsXULContentUtils.cpp
@@ -62,19 +62,17 @@
 using namespace mozilla;
 
 //------------------------------------------------------------------------
 
 nsIRDFService* nsXULContentUtils::gRDF;
 nsIDateTimeFormat* nsXULContentUtils::gFormat;
 nsICollation *nsXULContentUtils::gCollation;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
-#endif
 
 #define XUL_RESOURCE(ident, uri) nsIRDFResource* nsXULContentUtils::ident
 #define XUL_LITERAL(ident, val) nsIRDFLiteral* nsXULContentUtils::ident
 #include "nsXULResourceList.h"
 #undef XUL_RESOURCE
 #undef XUL_LITERAL
 
 //------------------------------------------------------------------------
--- a/dom/xul/templates/nsXULTemplateBuilder.cpp
+++ b/dom/xul/templates/nsXULTemplateBuilder.cpp
@@ -81,19 +81,17 @@ using namespace mozilla;
 
 nsrefcnt                  nsXULTemplateBuilder::gRefCnt = 0;
 nsIRDFService*            nsXULTemplateBuilder::gRDFService;
 nsIRDFContainerUtils*     nsXULTemplateBuilder::gRDFContainerUtils;
 nsIScriptSecurityManager* nsXULTemplateBuilder::gScriptSecurityManager;
 nsIPrincipal*             nsXULTemplateBuilder::gSystemPrincipal;
 nsIObserverService*       nsXULTemplateBuilder::gObserverService;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gXULTemplateLog;
-#endif
 
 #define NS_QUERY_PROCESSOR_CONTRACTID_PREFIX "@mozilla.org/xul/xul-query-processor;1?name="
 
 //----------------------------------------------------------------------
 //
 // nsXULTemplateBuilder methods
 //
 
@@ -162,20 +160,18 @@ nsXULTemplateBuilder::InitGlobals()
         if (NS_FAILED(rv))
             return rv;
 
         rv = CallGetService(NS_OBSERVERSERVICE_CONTRACTID, &gObserverService);
         if (NS_FAILED(rv))
             return rv;
     }
 
-#ifdef PR_LOGGING
     if (! gXULTemplateLog)
         gXULTemplateLog = PR_NewLogModule("nsXULTemplateBuilder");
-#endif
 
     return NS_OK;
 }
 
 void
 nsXULTemplateBuilder::StartObserving(nsIDocument* aDocument)
 {
     aDocument->AddObserver(this);
@@ -1709,21 +1705,19 @@ nsXULTemplateBuilder::CompileQueries()
       if (token.EqualsLiteral("dont-test-empty"))
         mFlags |= eDontTestEmpty;
       else if (token.EqualsLiteral("dont-recurse"))
         mFlags |= eDontRecurse;
       else if (token.EqualsLiteral("logging"))
         mFlags |= eLoggingEnabled;
     }
 
-#ifdef PR_LOGGING
     // always enable logging if the debug setting is used
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG))
         mFlags |= eLoggingEnabled;
-#endif
 
     nsCOMPtr<nsIDOMNode> rootnode = do_QueryInterface(mRoot);
     nsresult rv =
         mQueryProcessor->InitializeForBuilding(mDataSource, this, rootnode);
     if (NS_FAILED(rv))
         return rv;
 
     // Set the "container" and "member" variables, if the user has specified
--- a/dom/xul/templates/nsXULTemplateBuilder.h
+++ b/dom/xul/templates/nsXULTemplateBuilder.h
@@ -21,19 +21,17 @@
 #include "nsTArray.h"
 #include "nsDataHashtable.h"
 #include "nsTemplateRule.h"
 #include "nsTemplateMatch.h"
 #include "nsIXULTemplateQueryProcessor.h"
 #include "nsCycleCollectionParticipant.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
-#endif
 
 class nsIContent;
 class nsIObserverService;
 class nsIRDFCompositeDataSource;
 
 /**
  * An object that translates an RDF graph into a presentation using a
  * set of rules.
--- a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
+++ b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
@@ -478,33 +478,31 @@ nsXULTemplateQueryProcessorRDF::Generate
             TestNode* root = query->GetRoot();
 
             if (query->IsSimple() && mSimpleRuleMemberTest) {
                 // get the top node in the simple rule tree
                 root = mSimpleRuleMemberTest->GetParent();
                 mLastRef = aRef;
             }
 
-#ifdef PR_LOGGING
             if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
                 nsAutoString id;
                 aRef->GetId(id);
 
                 nsAutoString rvar;
                 query->mRefVariable->ToString(rvar);
                 nsAutoString mvar;
                 query->mMemberVariable->ToString(mvar);
 
                 PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                        ("QueryProcessor::GenerateResults using ref %s and vars [ ref: %s  member: %s]",
                        NS_ConvertUTF16toUTF8(id).get(),
                        NS_ConvertUTF16toUTF8(rvar).get(),
                        NS_ConvertUTF16toUTF8(mvar).get()));
             }
-#endif
 
             if (root) {
                 // the seed is the initial instantiation, which has a single
                 // assignment holding the reference point
                 Instantiation seed;
                 seed.AddAssignment(query->mRefVariable, refResource);
 
                 InstantiationSet* instantiations = new InstantiationSet();
@@ -860,30 +858,28 @@ 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;
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* sourceStr;
         aSource->GetValueConst(&sourceStr);
         const char* propertyStr;
         aProperty->GetValueConst(&propertyStr);
         nsAutoString targetStr;
         nsXULContentUtils::GetTextForNode(aTarget, targetStr);
 
         PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("nsXULTemplateQueryProcessorRDF::Propagate: [%s] -> [%s] -> [%s]\n",
                sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get()));
     }
-#endif
 
     {
         ReteNodeSet::Iterator last = mRDFTests.Last();
         for (ReteNodeSet::Iterator i = mRDFTests.First(); i != last; ++i) {
             nsRDFTestNode* rdftestnode = static_cast<nsRDFTestNode*>(*i);
 
             Instantiation seed;
             if (rdftestnode->CanPropagate(aSource, aProperty, aTarget, seed)) {
@@ -949,30 +945,28 @@ nsXULTemplateQueryProcessorRDF::Propagat
 
 
 nsresult
 nsXULTemplateQueryProcessorRDF::Retract(nsIRDFResource* aSource,
                                         nsIRDFResource* aProperty,
                                         nsIRDFNode* aTarget)
 {
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         const char* sourceStr;
         aSource->GetValueConst(&sourceStr);
         const char* propertyStr;
         aProperty->GetValueConst(&propertyStr);
         nsAutoString targetStr;
         nsXULContentUtils::GetTextForNode(aTarget, targetStr);
 
         PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("nsXULTemplateQueryProcessorRDF::Retract: [%s] -> [%s] -> [%s]\n",
                sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get()));
     }
-#endif
 
     // Retract any currently active rules that will no longer be matched.
     ReteNodeSet::ConstIterator lastnode = mRDFTests.Last();
     for (ReteNodeSet::ConstIterator node = mRDFTests.First(); node != lastnode; ++node) {
         const nsRDFTestNode* rdftestnode = static_cast<const nsRDFTestNode*>(*node);
 
         rdftestnode->Retract(aSource, aProperty, aTarget);
 
@@ -1018,17 +1012,16 @@ nsXULTemplateQueryProcessorRDF::Synchron
                 }
             }
         }
     }
 
     return NS_OK;
 }
 
-#ifdef PR_LOGGING
 nsresult
 nsXULTemplateQueryProcessorRDF::Log(const char* aOperation,
                                     nsIRDFResource* aSource,
                                     nsIRDFResource* aProperty,
                                     nsIRDFNode* aTarget)
 {
     if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
         nsresult rv;
@@ -1055,17 +1048,16 @@ nsXULTemplateQueryProcessorRDF::Log(cons
         targetstrC.AssignWithConversion(targetStr);
         PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
                ("                        --[%s]-->[%s]",
                 propertyStr,
                 targetstrC.get()));
     }
     return NS_OK;
 }
-#endif
 
 nsresult
 nsXULTemplateQueryProcessorRDF::CheckContainer(nsIRDFResource* aResource,
                                                bool* aIsContainer)
 {
     NS_ENSURE_ARG_POINTER(aIsContainer);
     NS_ENSURE_STATE(mDB);
 
@@ -1273,26 +1265,24 @@ nsXULTemplateQueryProcessorRDF::CompileQ
 
     if (aTag == nsGkAtoms::triple) {
         rv = CompileTripleCondition(aQuery, aCondition, aParentNode, aResult);
     }
     else if (aTag == nsGkAtoms::member) {
         rv = CompileMemberCondition(aQuery, aCondition, aParentNode, aResult);
     }
     else {
-#ifdef PR_LOGGING
         nsAutoString tagstr;
         aTag->ToString(tagstr);
 
         nsAutoCString tagstrC;
         tagstrC.AssignWithConversion(tagstr);
         PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
                ("xultemplate[%p] unrecognized condition test <%s>",
                 this, tagstrC.get()));
-#endif
 
         rv = NS_OK;
     }
 
     return rv;
 }
 
 nsresult
--- a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h
+++ b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h
@@ -24,19 +24,17 @@
 #include "nsCOMArray.h"
 #include "nsString.h"
 #include "nsClassHashtable.h"
 #include "nsRefPtrHashtable.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
-#endif
 
 class nsIContent;
 class nsXULTemplateResultRDF;
 
 /**
  * An object that generates results from a query on an RDF graph
  */
 class nsXULTemplateQueryProcessorRDF final : public nsIXULTemplateQueryProcessor,
@@ -251,30 +249,25 @@ public:
                  nsISupports** aResultNode);
 
     nsIRDFDataSource* GetDataSource() { return mDB; }
 
     nsIXULTemplateBuilder* GetBuilder() { return mBuilder; }
 
     nsResourceSet& ContainmentProperties() { return mContainmentProperties; }
 
-#ifdef PR_LOGGING
     nsresult
     Log(const char* aOperation,
         nsIRDFResource* aSource,
         nsIRDFResource* aProperty,
         nsIRDFNode* aTarget);
 
 #define LOG(_op, _src, _prop, _targ) \
     Log(_op, _src, _prop, _targ)
 
-#else
-#define LOG(_op, _src, _prop, _targ)
-#endif
-
 protected:
     ~nsXULTemplateQueryProcessorRDF();
 
     // We are an observer of the composite datasource. The cycle is
     // broken when the document is destroyed.
     nsCOMPtr<nsIRDFDataSource> mDB;
 
     // weak reference to the builder, cleared when the document is destroyed