Bug 1164620 - Part 1: Remove instances of #ifdef PR_LOGGING in various places. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Thu, 14 May 2015 10:13:24 -0700
changeset 276176 dd750b3d18c5c96a0a04069eefd8bca79dac14d2
parent 276175 d65f1ee84fbbef36ea9e72dddedca5f28d468d92
child 276177 037f6f313aba778f0354c5a13a4601afdd43e0dd
push id897
push userjlund@mozilla.com
push dateMon, 14 Sep 2015 18:56:12 +0000
treeherdermozilla-release@9411e2d2b214 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1164620
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 1164620 - Part 1: Remove instances of #ifdef PR_LOGGING in various places. r=froydnj PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
extensions/auth/nsAuth.h
extensions/auth/nsAuthFactory.cpp
extensions/auth/nsAuthGSSAPI.cpp
extensions/auth/nsAuthSSPI.cpp
extensions/gio/nsGIOProtocolHandler.cpp
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxGDIFontList.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/src/nsXPConnect.cpp
layout/base/AccessibleCaretEventHub.cpp
layout/base/AccessibleCaretManager.cpp
modules/libjar/nsJARChannel.cpp
modules/libjar/nsJARChannel.h
parser/htmlparser/nsExpatDriver.cpp
--- a/extensions/auth/nsAuth.h
+++ b/extensions/auth/nsAuth.h
@@ -9,23 +9,19 @@
 enum pType {
      PACKAGE_TYPE_KERBEROS,
      PACKAGE_TYPE_NEGOTIATE,
      PACKAGE_TYPE_NTLM
 };
 
 #include "prlog.h"
 
-#if defined( PR_LOGGING )
 //
 // in order to do logging, the following environment variables need to be set:
 // 
 //      set NSPR_LOG_MODULES=negotiateauth:4
 //      set NSPR_LOG_FILE=negotiateauth.log
 //
 extern PRLogModuleInfo* gNegotiateLog;
 
 #define LOG(args) PR_LOG(gNegotiateLog, PR_LOG_DEBUG, args)
-#else
-#define LOG(args)
-#endif
 
 #endif /* !defined( nsAuth_h__ ) */
--- a/extensions/auth/nsAuthFactory.cpp
+++ b/extensions/auth/nsAuthFactory.cpp
@@ -215,29 +215,25 @@ static const mozilla::Module::ContractID
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm", &kNS_SAMBANTLMAUTH_CID },
 #endif
   { NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "negotiate", &kNS_HTTPNEGOTIATEAUTH_CID },
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "sasl-gssapi", &kNS_AUTHSASL_CID },
   { nullptr }
 };
 
 //-----------------------------------------------------------------------------
-#if defined( PR_LOGGING )
 PRLogModuleInfo *gNegotiateLog;
 
 // setup nspr logging ...
 static nsresult
 InitNegotiateAuth()
 {
   gNegotiateLog = PR_NewLogModule("negotiateauth");
   return NS_OK;
 }
-#else
-#define InitNegotiateAuth nullptr
-#endif
 
 static void
 DestroyNegotiateAuth()
 {
   nsAuthGSSAPI::Shutdown();
 }
 
 static const mozilla::Module kAuthModule = {
--- a/extensions/auth/nsAuthGSSAPI.cpp
+++ b/extensions/auth/nsAuthGSSAPI.cpp
@@ -222,18 +222,16 @@ gssInit()
         return NS_ERROR_FAILURE;
     }
 #endif
 
     gssLibrary = lib;
     return NS_OK;
 }
 
-#if defined( PR_LOGGING )
-
 // 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)
 {
     OM_uint32 new_stat;
     OM_uint32 msg_ctx = 0;
     gss_buffer_desc status1_string;
@@ -265,22 +263,16 @@ LogGssError(OM_uint32 maj_stat, OM_uint3
                                      &status2_string);
         errorStr.Append((const char *) status2_string.value, status2_string.length);
         errorStr += '\n';
     } while (!GSS_ERROR(ret) && msg_ctx != 0);
 
     LOG(("%s\n", errorStr.get()));
 }
 
-#else /* PR_LOGGING */
-
-#define LogGssError(x,y,z)
-
-#endif /* PR_LOGGING */
-
 //-----------------------------------------------------------------------------
 
 nsAuthGSSAPI::nsAuthGSSAPI(pType package)
     : mServiceFlags(REQ_DEFAULT)
 {
     OM_uint32 minstat;
     OM_uint32 majstat;
     gss_OID_set mech_set;
--- a/extensions/auth/nsAuthSSPI.cpp
+++ b/extensions/auth/nsAuthSSPI.cpp
@@ -473,22 +473,21 @@ nsAuthSSPI::GetNextToken(const void *inT
                                             inToken ? &ibd : nullptr,
                                             0,
                                             &mCtxt,
                                             &obd,
                                             &ctxAttr,
                                             &ignored);
     if (rc == SEC_I_CONTINUE_NEEDED || rc == SEC_E_OK) {
 
-#ifdef PR_LOGGING
         if (rc == SEC_E_OK)
             LOG(("InitializeSecurityContext: succeeded.\n"));
         else
             LOG(("InitializeSecurityContext: continue.\n"));
-#endif
+
         if (sspi_cbt)
             free(sspi_cbt);
             
         if (!ob.cbBuffer) {
             free(ob.pvBuffer);
             ob.pvBuffer = nullptr;
         }
         *outToken = ob.pvBuffer;
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -23,22 +23,18 @@
 #include <algorithm>
 
 #define MOZ_GIO_SCHEME              "moz-gio"
 #define MOZ_GIO_SUPPORTED_PROTOCOLS "network.gio.supported-protocols"
 
 //-----------------------------------------------------------------------------
 
 // NSPR_LOG_MODULES=gio:5
-#ifdef PR_LOGGING
 static PRLogModuleInfo *sGIOLog;
 #define LOG(args) PR_LOG(sGIOLog, PR_LOG_DEBUG, args)
-#else
-#define LOG(args)
-#endif
 
 
 //-----------------------------------------------------------------------------
 static nsresult
 MapGIOResult(gint code) 
 {
   switch (code)
   {
@@ -901,19 +897,17 @@ class nsGIOProtocolHandler final : publi
     nsCString mSupportedProtocols;
 };
 
 NS_IMPL_ISUPPORTS(nsGIOProtocolHandler, nsIProtocolHandler, nsIObserver)
 
 nsresult
 nsGIOProtocolHandler::Init()
 {
-#ifdef PR_LOGGING
   sGIOLog = PR_NewLogModule("gio");
-#endif
 
   nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
   if (prefs)
   {
     InitSupportedProtocolsPref(prefs);
     prefs->AddObserver(MOZ_GIO_SUPPORTED_PROTOCOLS, this, false);
   }
 
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -31,29 +31,25 @@ using namespace mozilla;
 using namespace mozilla::unicode;
 
 #ifndef FC_POSTSCRIPT_NAME
 #define FC_POSTSCRIPT_NAME  "postscriptname"      /* String */
 #endif
 
 #define PRINTING_FC_PROPERTY "gfx.printing"
 
-#ifdef PR_LOGGING
-
 #define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
 #define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
 #define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_cmapdata), \
                                    PR_LOG_DEBUG)
 
-#endif
-
 static const FcChar8*
 ToFcChar8Ptr(const char* aStr)
 {
     return reinterpret_cast<const FcChar8*>(aStr);
 }
 
 static const char*
 ToCharPtr(const FcChar8 *aStr)
@@ -382,28 +378,26 @@ gfxFontconfigFontEntry::ReadCMAP(FontInf
     if (mHasCmapTable) {
         gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
         mCharacterMap = pfl->FindCharMap(charmap);
     } else {
         // if error occurred, initialize to null cmap
         mCharacterMap = new gfxCharacterMap();
     }
 
-#ifdef PR_LOGGING
     LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n",
                   NS_ConvertUTF16toUTF8(mName).get(),
                   charmap->SizeOfIncludingThis(moz_malloc_size_of),
                   charmap->mHash, mCharacterMap == charmap ? " new" : ""));
     if (LOG_CMAPDATA_ENABLED()) {
         char prefix[256];
         sprintf(prefix, "(cmapdata) name: %.220s",
                 NS_ConvertUTF16toUTF8(mName).get());
         charmap->Dump(prefix, eGfxLog_cmapdata);
     }
-#endif
 
     return rv;
 }
 
 static bool
 HasChar(FcPattern *aFont, FcChar32 aCh)
 {
     FcCharSet *charset = nullptr;
@@ -845,29 +839,27 @@ gfxFontconfigFontFamily::FindStyleVariat
         if (!psname.IsEmpty()) {
             fp->AddPostscriptName(fontEntry, psname);
         }
         NS_ASSERTION(!fullname.IsEmpty(), "empty font fullname");
         if (!fullname.IsEmpty()) {
             fp->AddFullname(fontEntry, fullname);
         }
 
-#ifdef PR_LOGGING
         if (LOG_FONTLIST_ENABLED()) {
             LOG_FONTLIST(("(fontlist) added (%s) to family (%s)"
                  " with style: %s weight: %d stretch: %d"
                  " psname: %s fullname: %s",
                  NS_ConvertUTF16toUTF8(fontEntry->Name()).get(),
                  NS_ConvertUTF16toUTF8(Name()).get(),
                  fontEntry->IsItalic() ? "italic" : "normal",
                  fontEntry->Weight(), fontEntry->Stretch(),
                  NS_ConvertUTF16toUTF8(psname).get(),
                  NS_ConvertUTF16toUTF8(fullname).get()));
         }
-#endif
     }
     mFaceNamesInitialized = true;
     mFontPatterns.Clear();
     SetHasStyles(true);
 }
 
 void
 gfxFontconfigFontFamily::AddFontPattern(FcPattern* aFontPattern)
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -522,22 +522,20 @@ GDIFontFamily::FindStyleVariations(FontI
     logFont.lfCharSet = DEFAULT_CHARSET;
     logFont.lfPitchAndFamily = 0;
     uint32_t l = std::min<uint32_t>(mName.Length(), LF_FACESIZE - 1);
     memcpy(logFont.lfFaceName, mName.get(), l * sizeof(char16_t));
 
     EnumFontFamiliesExW(hdc, &logFont,
                         (FONTENUMPROCW)GDIFontFamily::FamilyAddStylesProc,
                         (LPARAM)this, 0);
-#ifdef PR_LOGGING
     if (LOG_FONTLIST_ENABLED() && mAvailableFonts.Length() == 0) {
         LOG_FONTLIST(("(fontlist) no styles available in family \"%s\"",
                       NS_ConvertUTF16toUTF8(mName).get()));
     }
-#endif
 
     ReleaseDC(nullptr, hdc);
 
     if (mIsBadUnderlineFamily) {
         SetBadUnderlineFonts();
     }
 
     // check for existence of italic face(s); if present, set the
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -64,20 +64,18 @@ static const char kJSCachePrefix[] = "js
 
 /**
  * Buffer sizes for serialization and deserialization of scripts.
  * FIXME: bug #411579 (tune this macro!) Last updated: Jan 2008
  */
 #define XPC_SERIALIZATION_BUFFER_SIZE   (64 * 1024)
 #define XPC_DESERIALIZATION_BUFFER_SIZE (12 * 8192)
 
-#ifdef PR_LOGGING
 // NSPR_LOG_MODULES=JSComponentLoader:5
 static PRLogModuleInfo* gJSCLLog;
-#endif
 
 #define LOG(args) PR_LOG(gJSCLLog, PR_LOG_DEBUG, args)
 
 // Components.utils.import error messages
 #define ERROR_SCOPE_OBJ "%s - Second argument must be an object."
 #define ERROR_NOT_PRESENT "%s - EXPORTED_SYMBOLS is not present."
 #define ERROR_NOT_AN_ARRAY "%s - EXPORTED_SYMBOLS is not an array."
 #define ERROR_GETTING_ARRAY_LENGTH "%s - Error getting array length of EXPORTED_SYMBOLS."
@@ -194,21 +192,19 @@ mozJSComponentLoader::mozJSComponentLoad
     : mModules(16),
       mImports(16),
       mInProgressImports(16),
       mInitialized(false),
       mReuseLoaderGlobal(false)
 {
     MOZ_ASSERT(!sSelf, "mozJSComponentLoader should be a singleton");
 
-#ifdef PR_LOGGING
     if (!gJSCLLog) {
         gJSCLLog = PR_NewLogModule("JSComponentLoader");
     }
-#endif
 
     sSelf = this;
 }
 
 #define ENSURE_DEP(name) { nsresult rv = Ensure##name(); NS_ENSURE_SUCCESS(rv, rv); }
 #define ENSURE_DEPS(...) MOZ_FOR_EACH(ENSURE_DEP, (), (__VA_ARGS__));
 #define BEGIN_ENSURE(self, ...) { \
     if (m##self) \
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -211,19 +211,17 @@ xpc::ErrorReport::Init(JSErrorReport* aR
     mSourceLine = static_cast<const char16_t*>(aReport->uclinebuf);
 
     mLineNumber = aReport->lineno;
     mColumn = aReport->column;
     mFlags = aReport->flags;
     mIsMuted = aReport->isMuted;
 }
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo* gJSDiagnostics;
-#endif
 
 void
 xpc::ErrorReport::LogToConsole()
 {
     // Log to stdout.
     if (nsContentUtils::DOMWindowDumpEnabled()) {
         nsAutoCString error;
         error.AssignLiteral("JavaScript ");
@@ -238,27 +236,25 @@ xpc::ErrorReport::LogToConsole()
         error.AppendInt(mLineNumber, 10);
         error.AppendLiteral(": ");
         error.Append(NS_LossyConvertUTF16toASCII(mErrorMsg));
 
         fprintf(stderr, "%s\n", error.get());
         fflush(stderr);
     }
 
-#ifdef PR_LOGGING
     // Log to the PR Log Module.
     if (!gJSDiagnostics)
         gJSDiagnostics = PR_NewLogModule("JSDiagnostics");
     if (gJSDiagnostics) {
         PR_LOG(gJSDiagnostics,
                 JSREPORT_IS_WARNING(mFlags) ? PR_LOG_WARNING : PR_LOG_ERROR,
                 ("file %s, line %u\n%s", NS_LossyConvertUTF16toASCII(mFileName).get(),
                  mLineNumber, NS_LossyConvertUTF16toASCII(mErrorMsg).get()));
     }
-#endif
 
     // Log to the console. We do this last so that we can simply return if
     // there's no console service without affecting the other reporting
     // mechanisms.
     nsCOMPtr<nsIConsoleService> consoleService =
       do_GetService(NS_CONSOLESERVICE_CONTRACTID);
     nsCOMPtr<nsIScriptError> errorObject =
       do_CreateInstance("@mozilla.org/scripterror;1");
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -15,28 +15,24 @@
 #include "nsDocShell.h"
 #include "nsFocusManager.h"
 #include "nsFrameSelection.h"
 #include "nsITimer.h"
 #include "nsPresContext.h"
 
 namespace mozilla {
 
-#ifdef PR_LOGGING
-
 #undef AC_LOG
 #define AC_LOG(message, ...)                                                   \
   AC_LOG_BASE("AccessibleCaretEventHub (%p): " message, this, ##__VA_ARGS__);
 
 #undef AC_LOGV
 #define AC_LOGV(message, ...)                                                  \
   AC_LOGV_BASE("AccessibleCaretEventHub (%p): " message, this, ##__VA_ARGS__);
 
-#endif // #ifdef PR_LOGGING
-
 NS_IMPL_ISUPPORTS(AccessibleCaretEventHub, nsIReflowObserver, nsIScrollObserver,
                   nsISelectionListener, nsISupportsWeakReference);
 
 // -----------------------------------------------------------------------------
 // NoActionState
 //
 class AccessibleCaretEventHub::NoActionState
   : public AccessibleCaretEventHub::State
--- a/layout/base/AccessibleCaretManager.cpp
+++ b/layout/base/AccessibleCaretManager.cpp
@@ -16,28 +16,24 @@
 #include "nsContentUtils.h"
 #include "nsFocusManager.h"
 #include "nsFrame.h"
 #include "nsFrameSelection.h"
 #include "nsGenericHTMLElement.h"
 
 namespace mozilla {
 
-#ifdef PR_LOGGING
-
 #undef AC_LOG
 #define AC_LOG(message, ...)                                                   \
   AC_LOG_BASE("AccessibleCaretManager (%p): " message, this, ##__VA_ARGS__);
 
 #undef AC_LOGV
 #define AC_LOGV(message, ...)                                                  \
   AC_LOGV_BASE("AccessibleCaretManager (%p): " message, this, ##__VA_ARGS__);
 
-#endif // #ifdef PR_LOGGING
-
 using namespace dom;
 using Appearance = AccessibleCaret::Appearance;
 using PositionChangedResult = AccessibleCaret::PositionChangedResult;
 
 AccessibleCaretManager::AccessibleCaretManager(nsIPresShell* aPresShell)
   : mPresShell(aPresShell)
 {
   if (mPresShell) {
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -38,24 +38,21 @@ static NS_DEFINE_CID(kZipReaderCID, NS_Z
 //-----------------------------------------------------------------------------
 
 // Ignore any LOG macro that we inherit from arbitrary headers. (We define our
 // own LOG macro below.)
 #ifdef LOG
 #undef LOG
 #endif
 
-#if defined(PR_LOGGING)
 //
 // set NSPR_LOG_MODULES=nsJarProtocol:5
 //
 static PRLogModuleInfo *gJarProtocolLog = nullptr;
-#endif
 
-// If you ever want to define PR_FORCE_LOGGING in this file, see bug 545995
 #define LOG(args)     PR_LOG(gJarProtocolLog, PR_LOG_DEBUG, args)
 #define LOG_ENABLED() PR_LOG_TEST(gJarProtocolLog, 4)
 
 //-----------------------------------------------------------------------------
 // nsJARInputThunk
 //
 // this class allows us to do some extra work on the stream transport thread.
 //-----------------------------------------------------------------------------
@@ -198,20 +195,18 @@ nsJARChannel::nsJARChannel()
     , mContentLength(-1)
     , mLoadFlags(LOAD_NORMAL)
     , mStatus(NS_OK)
     , mIsPending(false)
     , mIsUnsafe(true)
     , mOpeningRemote(false)
     , mEnsureChildFd(false)
 {
-#if defined(PR_LOGGING)
     if (!gJarProtocolLog)
         gJarProtocolLog = PR_NewLogModule("nsJarProtocol");
-#endif
 
     // hold an owning reference to the jar handler
     NS_ADDREF(gJarHandler);
 }
 
 nsJARChannel::~nsJARChannel()
 {
     if (mLoadInfo) {
@@ -258,19 +253,17 @@ nsJARChannel::Init(nsIURI *uri)
     rv = innerURI->SchemeIs("javascript", &isJS);
     if (NS_FAILED(rv))
         return rv;
     if (isJS) {
         NS_WARNING("blocking jar:javascript:");
         return NS_ERROR_INVALID_ARG;
     }
 
-#if defined(PR_LOGGING)
     mJarURI->GetSpec(mSpec);
-#endif
     return rv;
 }
 
 nsresult
 nsJARChannel::CreateJarInput(nsIZipReaderCache *jarCache, nsJARInputThunk **resultInput)
 {
     MOZ_ASSERT(resultInput);
     MOZ_ASSERT(mJarFile || mTempMem);
@@ -1177,19 +1170,17 @@ nsJARChannel::OnStopRequest(nsIRequest *
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsJARChannel::OnDataAvailable(nsIRequest *req, nsISupports *ctx,
                                nsIInputStream *stream,
                                uint64_t offset, uint32_t count)
 {
-#if defined(PR_LOGGING)
     LOG(("nsJARChannel::OnDataAvailable [this=%x %s]\n", this, mSpec.get()));
-#endif
 
     nsresult rv;
 
     rv = mListener->OnDataAvailable(this, mListenerContext, stream, offset, count);
 
     // simply report progress here instead of hooking ourselves up as a
     // nsITransportEventSink implementation.
     // XXX do the 64-bit stuff for real
--- a/modules/libjar/nsJARChannel.h
+++ b/modules/libjar/nsJARChannel.h
@@ -64,19 +64,17 @@ private:
     nsresult SetRemoteNSPRFileDesc(PRFileDesc *fd);
     virtual void OnDownloadComplete(mozilla::net::MemoryDownloader* aDownloader,
                                     nsIRequest* aRequest,
                                     nsISupports* aCtxt,
                                     nsresult aStatus,
                                     mozilla::net::MemoryDownloader::Data aData)
         override;
 
-#if defined(PR_LOGGING)
     nsCString                       mSpec;
-#endif
 
     bool                            mOpened;
 
     nsCOMPtr<nsIJARURI>             mJarURI;
     nsCOMPtr<nsIURI>                mOriginalURI;
     nsCOMPtr<nsIURI>                mAppURI;
     nsCOMPtr<nsISupports>           mOwner;
     nsCOMPtr<nsILoadInfo>           mLoadInfo;
--- a/parser/htmlparser/nsExpatDriver.cpp
+++ b/parser/htmlparser/nsExpatDriver.cpp
@@ -28,26 +28,24 @@
 #include "nsError.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsUnicharInputStream.h"
 
 #define kExpatSeparatorChar 0xFFFF
 
 static const char16_t kUTF16[] = { 'U', 'T', 'F', '-', '1', '6', '\0' };
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo *
 GetExpatDriverLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("expatdriver");
   return sLog;
 }
-#endif
 
 /***************************** EXPAT CALL BACKS ******************************/
 // The callback handlers that get called from the expat parser.
 
 static void
 Driver_HandleXMLDeclaration(void *aUserData,
                             const XML_Char *aVersion,
                             const XML_Char *aEncoding,
@@ -1075,34 +1073,32 @@ nsExpatDriver::ConsumeToken(nsScanner& a
     const char16_t *buffer;
     uint32_t length;
     if (blocked || noMoreBuffers) {
       // If we're blocked we just resume Expat so we don't need a buffer, if
       // there aren't any more buffers we pass a null buffer to Expat.
       buffer = nullptr;
       length = 0;
 
-#if defined(PR_LOGGING) || defined (DEBUG)
       if (blocked) {
         PR_LOG(GetExpatDriverLog(), PR_LOG_DEBUG,
                ("Resuming Expat, will parse data remaining in Expat's "
                 "buffer.\nContent of Expat's buffer:\n-----\n%s\n-----\n",
                 NS_ConvertUTF16toUTF8(currentExpatPosition.get(),
                                       mExpatBuffered).get()));
       }
       else {
         NS_ASSERTION(mExpatBuffered == Distance(currentExpatPosition, end),
                      "Didn't pass all the data to Expat?");
         PR_LOG(GetExpatDriverLog(), PR_LOG_DEBUG,
                ("Last call to Expat, will parse data remaining in Expat's "
                 "buffer.\nContent of Expat's buffer:\n-----\n%s\n-----\n",
                 NS_ConvertUTF16toUTF8(currentExpatPosition.get(),
                                       mExpatBuffered).get()));
       }
-#endif
     }
     else {
       buffer = start.get();
       length = uint32_t(start.size_forward());
 
       PR_LOG(GetExpatDriverLog(), PR_LOG_DEBUG,
              ("Calling Expat, will parse data remaining in Expat's buffer and "
               "new data.\nContent of Expat's buffer:\n-----\n%s\n-----\nNew "