Bug 1452535 - Move some logs to level 1 r=mayhemer
authorKershaw Chang <kershaw@mozilla.com>
Fri, 16 Nov 2018 16:35:52 +0000
changeset 503225 e7720f22eab1ee92b069bcee8b504e9e1e67c8cd
parent 503224 599db31d59659e1e1bbf37eea6d12194811aa384
child 503226 0e6465e2cdf40c3b1f18e18c52e3285d49872c25
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1452535
milestone65.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 1452535 - Move some logs to level 1 r=mayhemer WPT parses HTTP log and create a HAR file. To reduce the overhead of logging, this patch moves some logs that are used by WPT parser to level 1. Differential Revision: https://phabricator.services.mozilla.com/D8986
netwerk/base/nsSocketTransport2.cpp
netwerk/base/nsSocketTransportService2.h
netwerk/dns/nsHostResolver.cpp
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/Http2Stream.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpResponseHead.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -876,19 +876,19 @@ nsSocketTransport::Init(const char **typ
         if (proxyType && (proxyInfo->IsHTTP() ||
                           proxyInfo->IsHTTPS() ||
                           proxyInfo->IsDirect() ||
                           !strcmp(proxyType, "unknown"))) {
             proxyType = nullptr;
         }
     }
 
-    SOCKET_LOG(("nsSocketTransport::Init [this=%p host=%s:%hu origin=%s:%d proxy=%s:%hu]\n",
-                this, mHost.get(), mPort, mOriginHost.get(), mOriginPort,
-                mProxyHost.get(), mProxyPort));
+    SOCKET_LOG1(("nsSocketTransport::Init [this=%p host=%s:%hu origin=%s:%d proxy=%s:%hu]\n",
+                 this, mHost.get(), mPort, mOriginHost.get(), mOriginPort,
+                 mProxyHost.get(), mProxyPort));
 
     // include proxy type as a socket type if proxy type is not "http"
     mTypeCount = typeCount + (proxyType != nullptr);
     if (!mTypeCount)
         return NS_OK;
 
     // if we have socket types, then the socket provider service had
     // better exist!
@@ -1042,18 +1042,18 @@ nsSocketTransport::PostEvent(uint32_t ty
         return NS_ERROR_OUT_OF_MEMORY;
 
     return mSocketTransportService->Dispatch(event, NS_DISPATCH_NORMAL);
 }
 
 void
 nsSocketTransport::SendStatus(nsresult status)
 {
-    SOCKET_LOG(("nsSocketTransport::SendStatus [this=%p status=%" PRIx32 "]\n", this,
-                static_cast<uint32_t>(status)));
+    SOCKET_LOG1(("nsSocketTransport::SendStatus [this=%p status=%" PRIx32 "]\n", this,
+                 static_cast<uint32_t>(status)));
 
     nsCOMPtr<nsITransportEventSink> sink;
     uint64_t progress;
     {
         MutexAutoLock lock(mLock);
         sink = mEventSink;
         switch (status) {
         case NS_NET_STATUS_SENDING_TO:
@@ -2270,17 +2270,17 @@ nsSocketTransport::OnSocketEvent(uint32_
 }
 
 //-----------------------------------------------------------------------------
 // socket handler impl
 
 void
 nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags)
 {
-    SOCKET_LOG(("nsSocketTransport::OnSocketReady [this=%p outFlags=%hd]\n",
+    SOCKET_LOG1(("nsSocketTransport::OnSocketReady [this=%p outFlags=%hd]\n",
         this, outFlags));
 
     if (outFlags == -1) {
         SOCKET_LOG(("socket timeout expired\n"));
         mCondition = NS_ERROR_NET_TIMEOUT;
         return;
     }
 
--- a/netwerk/base/nsSocketTransportService2.h
+++ b/netwerk/base/nsSocketTransportService2.h
@@ -32,16 +32,17 @@ class nsIPrefBranch;
 namespace mozilla {
 namespace net {
 
 //
 // set MOZ_LOG=nsSocketTransport:5
 //
 extern LazyLogModule gSocketTransportLog;
 #define SOCKET_LOG(args)     MOZ_LOG(gSocketTransportLog, LogLevel::Debug, args)
+#define SOCKET_LOG1(args)    MOZ_LOG(gSocketTransportLog, LogLevel::Error, args)
 #define SOCKET_LOG_ENABLED() MOZ_LOG_TEST(gSocketTransportLog, LogLevel::Debug)
 
 //
 // set MOZ_LOG=UDPSocket:5
 //
 extern LazyLogModule gUDPSocketLog;
 #define UDPSOCKET_LOG(args)     MOZ_LOG(gUDPSocketLog, LogLevel::Debug, args)
 #define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, LogLevel::Debug)
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -76,16 +76,17 @@ static_assert(HighThreadThreshold <= MAX
               "High Thread Threshold should be less equal Maximum allowed thread");
 
 //----------------------------------------------------------------------------
 
 namespace mozilla {
 namespace net {
 LazyLogModule gHostResolverLog("nsHostResolver");
 #define LOG(args) MOZ_LOG(mozilla::net::gHostResolverLog, mozilla::LogLevel::Debug, args)
+#define LOG1(args) MOZ_LOG(mozilla::net::gHostResolverLog, mozilla::LogLevel::Error, args)
 #define LOG_ENABLED() MOZ_LOG_TEST(mozilla::net::gHostResolverLog, mozilla::LogLevel::Debug)
 }
 }
 
 //----------------------------------------------------------------------------
 
 #if defined(RES_RETRY_ON_FAILURE)
 
@@ -2168,18 +2169,18 @@ nsHostResolver::ThreadFunc()
             if (!GetHostToLookup(getter_AddRefs(tmpRec))) {
                 break; // thread shutdown signal
             }
             // GetHostToLookup() returns an owning reference
             MOZ_ASSERT(tmpRec);
             rec.swap(tmpRec);
         }
 
-        LOG(("DNS lookup thread - Calling getaddrinfo for host [%s].\n",
-             rec->host.get()));
+        LOG1(("DNS lookup thread - Calling getaddrinfo for host [%s].\n",
+              rec->host.get()));
 
         TimeStamp startTime = TimeStamp::Now();
         bool getTtl = rec->mGetTtl;
         TimeDuration inQueue = startTime - rec->mNativeStart;
         uint32_t ms = static_cast<uint32_t>(inQueue.ToMilliseconds());
         Telemetry::Accumulate(Telemetry::DNS_NATIVE_QUEUING, ms);
         nsresult status = GetAddrInfo(rec->host, rec->af,
                                       rec->flags, &ai,
@@ -2212,19 +2213,19 @@ nsHostResolver::ThreadFunc()
                     }
                     Telemetry::Accumulate(histogramID, millis);
                 } else {
                     Telemetry::Accumulate(Telemetry::DNS_FAILED_LOOKUP_TIME, millis);
                 }
             }
         }
 
-        LOG(("DNS lookup thread - lookup completed for host [%s]: %s.\n",
-             rec->host.get(),
-             ai ? "success" : "failure: unknown host"));
+        LOG1(("DNS lookup thread - lookup completed for host [%s]: %s.\n",
+              rec->host.get(),
+              ai ? "success" : "failure: unknown host"));
 
         if (LOOKUP_RESOLVEAGAIN == CompleteLookup(rec, status, ai, rec->pb,
                                                   rec->originSuffix)) {
             // leave 'rec' assigned and loop to make a renewed host resolve
             LOG(("DNS lookup thread - Re-resolving host [%s].\n", rec->host.get()));
         } else {
             rec = nullptr;
         }
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -390,17 +390,17 @@ Http2Session::RegisterStreamID(Http2Stre
 
   if (!aNewID) {
     // auto generate a new pull stream ID
     aNewID = mNextStreamID;
     MOZ_ASSERT(aNewID & 1, "pull ID must be odd.");
     mNextStreamID += 2;
   }
 
-  LOG3(("Http2Session::RegisterStreamID session=%p stream=%p id=0x%X "
+  LOG1(("Http2Session::RegisterStreamID session=%p stream=%p id=0x%X "
         "concurrent=%d",this, stream, aNewID, mConcurrent));
 
   // We've used up plenty of ID's on this session. Start
   // moving to a new one before there is a crunch involving
   // server push streams or concurrent non-registered submits
   if (aNewID >= kMaxStreamID)
     mShouldGoAway = true;
 
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -77,17 +77,17 @@ Http2Stream::Http2Stream(nsAHttpTransact
   , mAttempting0RTT(false)
   , mIsTunnel(false)
   , mPlainTextTunnel(false)
   , mIsWebsocket(false)
 {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
   nsHttpTransaction *trans = mTransaction->QueryHttpTransaction();
-  LOG3(("Http2Stream::Http2Stream %p trans=%p atrans=%p", this, trans, httpTransaction));
+  LOG1(("Http2Stream::Http2Stream %p trans=%p atrans=%p", this, trans, httpTransaction));
 
   mServerReceiveWindow = session->GetServerInitialStreamWindow();
   mClientReceiveWindow = session->PushAllowance();
 
   mTxInlineFrame = MakeUnique<uint8_t[]>(mTxInlineFrameSize);
 
   static_assert(nsISupportsPriority::PRIORITY_LOWEST <= kNormalPriority,
                 "Lowest Priority should be less than kNormalPriority");
@@ -662,17 +662,17 @@ Http2Stream::GenerateOpen()
   messageSize += Http2Session::kFrameHeaderBytes + 5; // frame header + priority overhead in HEADERS frame
   messageSize += (numFrames - 1) * Http2Session::kFrameHeaderBytes; // frame header overhead in CONTINUATION frames
 
   EnsureBuffer(mTxInlineFrame, messageSize,
                mTxInlineFrameUsed, mTxInlineFrameSize);
 
   mTxInlineFrameUsed += messageSize;
   UpdatePriorityDependency();
-  LOG3(("Http2Stream %p Generating %d bytes of HEADERS for stream 0x%X with "
+  LOG1(("Http2Stream %p Generating %d bytes of HEADERS for stream 0x%X with "
         "priority weight %u dep 0x%X frames %u uri=%s\n",
         this, mTxInlineFrameUsed, mStreamID, mPriorityWeight,
         mPriorityDependency, numFrames, requestURI.get()));
 
   uint32_t outputOffset = 0;
   uint32_t compressedDataOffset = 0;
   for (uint32_t idx = 0; idx < numFrames; ++idx) {
     uint32_t flags, frameLen;
@@ -1341,17 +1341,17 @@ Http2Stream::UpdatePriorityDependency()
     LOG3(("Http2Stream::UpdatePriorityDependency %p "
           " depends on background group for trans %p\n",
           this, trans));
     mPriorityDependency = Http2Session::kBackgroundGroupID;
 
     nsHttp::NotifyActiveTabLoadOptimization();
   }
 
-  LOG3(("Http2Stream::UpdatePriorityDependency %p "
+  LOG1(("Http2Stream::UpdatePriorityDependency %p "
         "depends on stream 0x%X\n",
         this, mPriorityDependency));
 }
 
 void
 Http2Stream::TopLevelOuterContentWindowIdChanged(uint64_t windowId)
 {
   if (!mStreamID) {
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -341,17 +341,17 @@ HttpBaseChannel::SetIsTrackingResource(b
 nsresult
 HttpBaseChannel::Init(nsIURI *aURI,
                       uint32_t aCaps,
                       nsProxyInfo *aProxyInfo,
                       uint32_t aProxyResolveFlags,
                       nsIURI *aProxyURI,
                       uint64_t aChannelId)
 {
-  LOG(("HttpBaseChannel::Init [this=%p]\n", this));
+  LOG1(("HttpBaseChannel::Init [this=%p]\n", this));
 
   MOZ_ASSERT(aURI, "null uri");
 
   mURI = aURI;
   mOriginalURI = aURI;
   mDocumentURI = nullptr;
   mCaps = aCaps;
   mProxyResolveFlags = aProxyResolveFlags;
@@ -371,21 +371,21 @@ HttpBaseChannel::Init(nsIURI *aURI,
 
   // Reject the URL if it doesn't specify a host
   if (host.IsEmpty())
     return NS_ERROR_MALFORMED_URI;
 
   rv = mURI->GetPort(&port);
   if (NS_FAILED(rv)) return rv;
 
-  LOG(("host=%s port=%d\n", host.get(), port));
+  LOG1(("host=%s port=%d\n", host.get(), port));
 
   rv = mURI->GetAsciiSpec(mSpec);
   if (NS_FAILED(rv)) return rv;
-  LOG(("uri=%s\n", mSpec.get()));
+  LOG1(("uri=%s\n", mSpec.get()));
 
   // Assert default request method
   MOZ_ASSERT(mRequestHead.EqualsMethod(nsHttpRequestHead::kMethod_Get));
 
   // Set request headers
   nsAutoCString hostLine;
   rv = nsHttpHandler::GenerateHostPort(host, port, hostLine);
   if (NS_FAILED(rv)) return rv;
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -417,17 +417,17 @@ nsHttpChannel::Init(nsIURI *uri,
                     nsIURI *proxyURI,
                     uint64_t channelId)
 {
     nsresult rv = HttpBaseChannel::Init(uri, caps, proxyInfo,
                                         proxyResolveFlags, proxyURI, channelId);
     if (NS_FAILED(rv))
         return rv;
 
-    LOG(("nsHttpChannel::Init [this=%p]\n", this));
+    LOG1(("nsHttpChannel::Init [this=%p]\n", this));
 
     return rv;
 }
 
 nsresult
 nsHttpChannel::AddSecurityMessage(const nsAString& aMessageTag,
                                   const nsAString& aMessageCategory)
 {
@@ -1366,17 +1366,17 @@ nsHttpChannel::SetupTransaction()
 
     // create wrapper for this channel's notification callbacks
     nsCOMPtr<nsIInterfaceRequestor> callbacks;
     NS_NewNotificationCallbacksAggregation(mCallbacks, mLoadGroup,
                                            getter_AddRefs(callbacks));
 
     // create the transaction object
     mTransaction = new nsHttpTransaction();
-    LOG(("nsHttpChannel %p created nsHttpTransaction %p\n", this, mTransaction.get()));
+    LOG1(("nsHttpChannel %p created nsHttpTransaction %p\n", this, mTransaction.get()));
     mTransaction->SetTransactionObserver(mTransactionObserver);
     mTransactionObserver = nullptr;
 
     // See bug #466080. Transfer LOAD_ANONYMOUS flag to socket-layer.
     if (mLoadFlags & LOAD_ANONYMOUS)
         mCaps |= NS_HTTP_LOAD_ANONYMOUS;
 
     if (mTimingEnabled)
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -176,17 +176,17 @@ nsHttpConnection::Init(nsHttpConnectionI
                        uint16_t maxHangTime,
                        nsISocketTransport *transport,
                        nsIAsyncInputStream *instream,
                        nsIAsyncOutputStream *outstream,
                        bool connectedTransport,
                        nsIInterfaceRequestor *callbacks,
                        PRIntervalTime rtt)
 {
-    LOG(("nsHttpConnection::Init this=%p sockettransport=%p", this, transport));
+    LOG1(("nsHttpConnection::Init this=%p sockettransport=%p", this, transport));
     NS_ENSURE_ARG_POINTER(info);
     NS_ENSURE_TRUE(!mConnInfo, NS_ERROR_ALREADY_INITIALIZED);
 
     mConnectedTransport = connectedTransport;
     mConnInfo = info;
     MOZ_ASSERT(mConnInfo);
     mLastWriteTime = mLastReadTime = PR_IntervalNow();
     mRtt = rtt;
@@ -450,39 +450,39 @@ nsHttpConnection::EnsureNPNComplete(nsre
         // (AlpnEarlySelection), we are using HTTP/1, and the request data can
         // be safely retried.
         m0RTTChecked = true;
         nsresult rvEarlyAlpn = ssl->GetAlpnEarlySelection(mEarlyNegotiatedALPN);
         if (NS_FAILED(rvEarlyAlpn)) {
             // if ssl->DriveHandshake() has never been called the value
             // for AlpnEarlySelection is still not set. So call it here and
             // check again.
-            LOG(("nsHttpConnection::EnsureNPNComplete %p - "
-                 "early selected alpn not available, we will try one more time.",
-                 this));
+            LOG1(("nsHttpConnection::EnsureNPNComplete %p - "
+                  "early selected alpn not available, we will try one more time.",
+                  this));
             // Let's do DriveHandshake again.
             rv = ssl->DriveHandshake();
             if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK) {
                 goto npnComplete;
             }
 
             // Check NegotiatedNPN first.
             rv = ssl->GetNegotiatedNPN(negotiatedNPN);
             if (rv == NS_ERROR_NOT_CONNECTED) {
                 rvEarlyAlpn = ssl->GetAlpnEarlySelection(mEarlyNegotiatedALPN);
             }
         }
 
         if (NS_FAILED(rvEarlyAlpn)) {
-            LOG(("nsHttpConnection::EnsureNPNComplete %p - "
-                 "early selected alpn not available", this));
+            LOG1(("nsHttpConnection::EnsureNPNComplete %p - "
+                  "early selected alpn not available", this));
             mEarlyDataNegotiated = false;
         } else {
-            LOG(("nsHttpConnection::EnsureNPNComplete %p -"
-                 "early selected alpn: %s", this, mEarlyNegotiatedALPN.get()));
+            LOG1(("nsHttpConnection::EnsureNPNComplete %p -"
+                  "early selected alpn: %s", this, mEarlyNegotiatedALPN.get()));
             uint32_t infoIndex;
             const SpdyInformation *info = gHttpHandler->SpdyInfo();
             if (NS_FAILED(info->GetNPNIndex(mEarlyNegotiatedALPN, &infoIndex))) {
                 // This is the HTTP/1 case.
                 // Check if early-data is allowed for this transaction.
                 if (mTransaction->Do0RTT()) {
                     LOG(("nsHttpConnection::EnsureNPNComplete [this=%p] - We "
                          "can do 0RTT (http/1)!", this));
@@ -520,19 +520,19 @@ nsHttpConnection::EnsureNPNComplete(nsre
         if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK) {
             goto npnComplete;
         }
 
         return false;
     }
 
     if (NS_SUCCEEDED(rv)) {
-        LOG(("nsHttpConnection::EnsureNPNComplete %p [%s] negotiated to '%s'%s\n",
-             this, mConnInfo->HashKey().get(), negotiatedNPN.get(),
-             mTLSFilter ? " [Double Tunnel]" : ""));
+        LOG1(("nsHttpConnection::EnsureNPNComplete %p [%s] negotiated to '%s'%s\n",
+              this, mConnInfo->HashKey().get(), negotiatedNPN.get(),
+              mTLSFilter ? " [Double Tunnel]" : ""));
 
         handshakeSucceeded = true;
 
         int16_t tlsVersion;
         ssl->GetSSLVersionUsed(&tlsVersion);
         mConnInfo->SetLessThanTls13((tlsVersion < nsISSLSocketControl::TLS_VERSION_1_3) &&
                                     (tlsVersion != nsISSLSocketControl::SSL_VERSION_UNKNOWN));
 
@@ -675,18 +675,18 @@ nsHttpConnection::OnTunnelNudged(TLSFilt
     Unused << OnSocketWritable();
 }
 
 // called on the socket thread
 nsresult
 nsHttpConnection::Activate(nsAHttpTransaction *trans, uint32_t caps, int32_t pri)
 {
     MOZ_ASSERT(OnSocketThread(), "not on socket thread");
-    LOG(("nsHttpConnection::Activate [this=%p trans=%p caps=%x]\n",
-         this, trans, caps));
+    LOG1(("nsHttpConnection::Activate [this=%p trans=%p caps=%x]\n",
+          this, trans, caps));
 
     if (!mExperienced && !trans->IsNullTransaction()) {
         if (!mFastOpen) {
             mExperienced = true;
         }
         if (mBootstrappedTimingsSet) {
             mBootstrappedTimingsSet = false;
             nsHttpTransaction *hTrans = trans->QueryHttpTransaction();
@@ -805,18 +805,18 @@ failed_activation:
     }
 
     return rv;
 }
 
 void
 nsHttpConnection::SetupSSL()
 {
-    LOG(("nsHttpConnection::SetupSSL %p caps=0x%X %s\n",
-         this, mTransactionCaps, mConnInfo->HashKey().get()));
+    LOG1(("nsHttpConnection::SetupSSL %p caps=0x%X %s\n",
+          this, mTransactionCaps, mConnInfo->HashKey().get()));
 
     if (mSetupSSLCalled) // do only once
         return;
     mSetupSSLCalled = true;
 
     if (mNPNComplete)
         return;
 
--- a/netwerk/protocol/http/nsHttpResponseHead.cpp
+++ b/netwerk/protocol/http/nsHttpResponseHead.cpp
@@ -574,18 +574,18 @@ nsHttpResponseHead::ParseStatusLine_lock
             AssignDefaultStatusText();
         }
         else {
             p = start + index + 1;
             mStatusText = nsDependentCSubstring(p, end - p);
         }
     }
 
-    LOG(("Have status line [version=%u status=%u statusText=%s]\n",
-        unsigned(mVersion), unsigned(mStatus), mStatusText.get()));
+    LOG1(("Have status line [version=%u status=%u statusText=%s]\n",
+          unsigned(mVersion), unsigned(mStatus), mStatusText.get()));
 }
 
 nsresult
 nsHttpResponseHead::ParseHeaderLine(const nsACString &line)
 {
     RecursiveMutexAutoLock monitor(mRecursiveMutex);
     return ParseHeaderLine_locked(line, true);
 }
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -74,17 +74,17 @@ LogHeaders(const char *lineStart)
     while ((endOfLine = PL_strstr(lineStart, "\r\n"))) {
         buf.Assign(lineStart, endOfLine - lineStart);
         if (PL_strcasestr(buf.get(), "authorization: ") ||
             PL_strcasestr(buf.get(), "proxy-authorization: ")) {
             char *p = PL_strchr(PL_strchr(buf.get(), ' ') + 1, ' ');
             while (p && *++p)
                 *p = '*';
         }
-        LOG3(("  %s\n", buf.get()));
+        LOG1(("  %s\n", buf.get()));
         lineStart = endOfLine + 2;
     }
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpTransaction <public>
 //-----------------------------------------------------------------------------
 
@@ -279,17 +279,17 @@ nsHttpTransaction::Init(uint32_t caps,
                         nsIEventTarget *target,
                         nsIInterfaceRequestor *callbacks,
                         nsITransportEventSink *eventsink,
                         uint64_t topLevelOuterContentWindowId,
                         nsIAsyncInputStream **responseBody)
 {
     nsresult rv;
 
-    LOG(("nsHttpTransaction::Init [this=%p caps=%x]\n", this, caps));
+    LOG1(("nsHttpTransaction::Init [this=%p caps=%x]\n", this, caps));
 
     MOZ_ASSERT(cinfo);
     MOZ_ASSERT(requestHead);
     MOZ_ASSERT(target);
     MOZ_ASSERT(NS_IsMainThread());
 
     mTopLevelOuterContentWindowId = topLevelOuterContentWindowId;
     LOG(("  window-id = %" PRIx64, mTopLevelOuterContentWindowId));
@@ -365,20 +365,20 @@ nsHttpTransaction::Init(uint32_t caps,
 
     // make sure we eliminate any proxy specific headers from
     // the request if we are using CONNECT
     bool pruneProxyHeaders = cinfo->UsingConnect();
 
     mReqHeaderBuf.Truncate();
     requestHead->Flatten(mReqHeaderBuf, pruneProxyHeaders);
 
-    if (LOG3_ENABLED()) {
-        LOG3(("http request [\n"));
+    if (LOG1_ENABLED()) {
+        LOG1(("http request [\n"));
         LogHeaders(mReqHeaderBuf.get());
-        LOG3(("]\n"));
+        LOG1(("]\n"));
     }
 
     // If the request body does not include headers or if there is no request
     // body, then we must add the header/body separator manually.
     if (!requestBodyHasHeaders || !requestBody)
         mReqHeaderBuf.AppendLiteral("\r\n");
 
     // report the request header
@@ -616,18 +616,18 @@ nsHttpTransaction::SetSecurityCallbacks(
         gSocketTransportService->Dispatch(event, nsIEventTarget::DISPATCH_NORMAL);
     }
 }
 
 void
 nsHttpTransaction::OnTransportStatus(nsITransport* transport,
                                      nsresult status, int64_t progress)
 {
-    LOG(("nsHttpTransaction::OnSocketStatus [this=%p status=%" PRIx32 " progress=%" PRId64 "]\n",
-         this, static_cast<uint32_t>(status), progress));
+    LOG1(("nsHttpTransaction::OnSocketStatus [this=%p status=%" PRIx32 " progress=%" PRId64 "]\n",
+          this, static_cast<uint32_t>(status), progress));
 
     if (status == NS_NET_STATUS_CONNECTED_TO ||
         status == NS_NET_STATUS_WAITING_FOR) {
         nsISocketTransport *socketTransport =
             mConnection ? mConnection->Transport() : nullptr;
         if (socketTransport) {
             MutexAutoLock lock(mLock);
             socketTransport->GetSelfAddr(&mSelfAddr);
@@ -712,34 +712,34 @@ nsHttpTransaction::OnTransportStatus(nsI
     if (status == NS_NET_STATUS_RECEIVING_FROM)
         return;
 
     int64_t progressMax;
 
     if (status == NS_NET_STATUS_SENDING_TO) {
         // suppress progress when only writing request headers
         if (!mHasRequestBody) {
-            LOG(("nsHttpTransaction::OnTransportStatus %p "
-                 "SENDING_TO without request body\n", this));
+            LOG1(("nsHttpTransaction::OnTransportStatus %p "
+                  "SENDING_TO without request body\n", this));
             return;
         }
 
         if (mReader) {
             // A mRequestStream method is on the stack - wait.
             LOG(("nsHttpTransaction::OnSocketStatus [this=%p] "
                  "Skipping Re-Entrant NS_NET_STATUS_SENDING_TO\n", this));
             // its ok to coalesce several of these into one deferred event
             mDeferredSendProgress = true;
             return;
         }
 
         nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mRequestStream);
         if (!seekable) {
-            LOG(("nsHttpTransaction::OnTransportStatus %p "
-                 "SENDING_TO without seekable request stream\n", this));
+            LOG1(("nsHttpTransaction::OnTransportStatus %p "
+                  "SENDING_TO without seekable request stream\n", this));
             progress = 0;
         } else {
             int64_t prog = 0;
             seekable->Tell(&prog);
             progress = prog;
         }
 
         // when uploading, we include the request headers in the progress
@@ -1426,17 +1426,17 @@ nsHttpTransaction::LocateHttpStart(char 
         len--;
     }
     return nullptr;
 }
 
 nsresult
 nsHttpTransaction::ParseLine(nsACString &line)
 {
-    LOG(("nsHttpTransaction::ParseLine [%s]\n", PromiseFlatCString(line).get()));
+    LOG1(("nsHttpTransaction::ParseLine [%s]\n", PromiseFlatCString(line).get()));
     nsresult rv = NS_OK;
 
     if (!mHaveStatusLine) {
         mResponseHead->ParseStatusLine(line);
         mHaveStatusLine = true;
         // XXX this should probably never happen
         if (mResponseHead->Version() == HttpVersion::v0_9)
             mHaveAllHeaders = true;
@@ -1836,18 +1836,18 @@ nsHttpTransaction::HandleContent(char *b
         *contentRead = count;
     }
 
     if (*contentRead) {
         // update count of content bytes read and report progress...
         mContentRead += *contentRead;
     }
 
-    LOG(("nsHttpTransaction::HandleContent [this=%p count=%u read=%u mContentRead=%" PRId64 " mContentLength=%" PRId64 "]\n",
-        this, count, *contentRead, mContentRead, mContentLength));
+    LOG1(("nsHttpTransaction::HandleContent [this=%p count=%u read=%u mContentRead=%" PRId64 " mContentLength=%" PRId64 "]\n",
+          this, count, *contentRead, mContentRead, mContentLength));
 
     // check for end-of-file
     if ((mContentRead == mContentLength) ||
         (mChunkedDecoder && mChunkedDecoder->ReachedEOF())) {
         MutexAutoLock lock(*nsHttp::GetLock());
         if (mChunkedDecoder) {
             mForTakeResponseTrailers = mChunkedDecoder->TakeTrailers();
         }
@@ -1880,17 +1880,17 @@ nsHttpTransaction::HandleContent(char *b
     return NS_OK;
 }
 
 nsresult
 nsHttpTransaction::ProcessData(char *buf, uint32_t count, uint32_t *countRead)
 {
     nsresult rv;
 
-    LOG(("nsHttpTransaction::ProcessData [this=%p count=%u]\n", this, count));
+    LOG1(("nsHttpTransaction::ProcessData [this=%p count=%u]\n", this, count));
 
     *countRead = 0;
 
     // we may not have read all of the headers yet...
     if (!mHaveAllHeaders) {
         uint32_t bytesConsumed = 0;
 
         do {
@@ -1973,17 +1973,17 @@ nsHttpTransaction::ProcessData(char *buf
     }
 
     return NS_OK;
 }
 
 void
 nsHttpTransaction::SetRequestContext(nsIRequestContext *aRequestContext)
 {
-    LOG(("nsHttpTransaction %p SetRequestContext %p\n", this, aRequestContext));
+    LOG1(("nsHttpTransaction %p SetRequestContext %p\n", this, aRequestContext));
     mRequestContext = aRequestContext;
 }
 
 // Called when the transaction marked for blocking is associated with a connection
 // (i.e. added to a new h1 conn, an idle http connection, etc..)
 // It is safe to call this multiple times with it only
 // having an effect once.
 void