Bug 1463266 - remove \n in MOZ_LOG and NS_ERROR. r=me DONTBUILD
authorJorg K <jorgk@jorgk.com>
Wed, 09 Oct 2019 11:43:54 +0200
changeset 37111 328093467a6516099d5bdc111f8e3129674b5926
parent 37110 58c46e562118f7abfe56eca1b3e43bee42d4430e
child 37112 405b859c20d740773221def38155930710d1ef85
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersme
bugs1463266
Bug 1463266 - remove \n in MOZ_LOG and NS_ERROR. r=me DONTBUILD
ldap/xpcom/src/nsLDAPConnection.cpp
mailnews/db/msgdb/src/nsMsgDatabase.cpp
mailnews/local/src/nsMailboxProtocol.cpp
mailnews/local/src/nsMsgMaildirStore.cpp
mailnews/mapi/mapihook/src/msgMapiImp.cpp
mailnews/news/src/nsNNTPProtocol.cpp
--- a/ldap/xpcom/src/nsLDAPConnection.cpp
+++ b/ldap/xpcom/src/nsLDAPConnection.cpp
@@ -86,17 +86,17 @@ nsLDAPConnection::Init(nsILDAPURL *aUrl,
   mBindName.Assign(aBindName);
   mClosure = aClosure;
   mInitListener = aMessageListener;
 
   // Make sure we haven't called Init earlier, i.e. there's a DNS
   // request pending.
   NS_ASSERTION(!mDNSRequest,
                "nsLDAPConnection::Init() "
-               "Connection was already initialized\n");
+               "Connection was already initialized");
 
   // Check and save the version number
   if (aVersion != nsILDAPConnection::VERSION2 &&
       aVersion != nsILDAPConnection::VERSION3) {
     NS_ERROR("nsLDAPConnection::Init(): illegal version");
     return NS_ERROR_ILLEGAL_VALUE;
   }
   mVersion = aVersion;
@@ -166,32 +166,32 @@ nsLDAPConnection::Init(nsILDAPURL *aUrl,
   }
   return rv;
 }
 
 // this might get exposed to clients, so we've broken it
 // out of the destructor.
 void nsLDAPConnection::Close() {
   int rc;
-  MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug, ("unbinding\n"));
+  MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug, ("unbinding"));
 
   if (mConnectionHandle) {
     // note that the ldap_unbind() call in the 5.0 version of the LDAP C SDK
     // appears to be exactly identical to ldap_unbind_s(), so it may in fact
     // still be synchronous
     //
     rc = ldap_unbind(mConnectionHandle);
     if (rc != LDAP_SUCCESS) {
       MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Warning,
-              ("nsLDAPConnection::Close(): %s\n", ldap_err2string(rc)));
+              ("nsLDAPConnection::Close(): %s", ldap_err2string(rc)));
     }
     mConnectionHandle = nullptr;
   }
 
-  MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug, ("unbound\n"));
+  MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug, ("unbound"));
 
   NS_ASSERTION(!mThread || NS_SUCCEEDED(mThread->Shutdown()),
                "Failed to shutdown thread cleanly");
 
   // Cancel the DNS lookup if needed, and also drop the reference to the
   // Init listener (if still there).
   //
   if (mDNSRequest) {
@@ -305,17 +305,17 @@ nsresult nsLDAPConnection::AddPendingOpe
   NS_ENSURE_ARG_POINTER(aOperation);
 
   nsIRunnable *runnable =
       new nsLDAPConnectionRunnable(aOperationID, aOperation, this);
   {
     MutexAutoLock lock(mPendingOperationsMutex);
     mPendingOperations.Put((uint32_t)aOperationID, aOperation);
     MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug,
-            ("pending operation added; total pending operations now = %d\n",
+            ("pending operation added; total pending operations now = %d",
              mPendingOperations.Count()));
   }
 
   nsresult rv;
   if (!mThread) {
     rv = NS_NewThread(getter_AddRefs(mThread), runnable);
     NS_ENSURE_SUCCESS(rv, rv);
   } else {
@@ -336,24 +336,24 @@ nsresult nsLDAPConnection::AddPendingOpe
  * @exception NS_ERROR_FAILURE      could not delete the operation
  *
  * void removePendingOperation(in nsILDAPOperation aOperation);
  */
 nsresult nsLDAPConnection::RemovePendingOperation(uint32_t aOperationID) {
   NS_ENSURE_TRUE(aOperationID > 0, NS_ERROR_UNEXPECTED);
 
   MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug,
-          ("nsLDAPConnection::RemovePendingOperation(): operation removed\n"));
+          ("nsLDAPConnection::RemovePendingOperation(): operation removed"));
 
   {
     MutexAutoLock lock(mPendingOperationsMutex);
     mPendingOperations.Remove(aOperationID);
     MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug,
             ("nsLDAPConnection::RemovePendingOperation(): operation "
-             "removed; total pending operations now = %d\n",
+             "removed; total pending operations now = %d",
              mPendingOperations.Count()));
   }
 
   return NS_OK;
 }
 
 class nsOnLDAPMessageRunnable : public Runnable {
  public:
@@ -390,17 +390,17 @@ NS_IMETHODIMP nsOnLDAPMessageRunnable::R
 nsresult nsLDAPConnection::InvokeMessageCallback(LDAPMessage *aMsgHandle,
                                                  nsILDAPMessage *aMsg,
                                                  int32_t aOperation,
                                                  bool aRemoveOpFromConnQ) {
 #if defined(DEBUG)
   // We only want this being logged for debug builds so as not to affect
   // performance too much.
   MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug,
-          ("InvokeMessageCallback entered\n"));
+          ("InvokeMessageCallback entered"));
 #endif
 
   // Get the operation.
   nsCOMPtr<nsILDAPOperation> operation;
   {
     MutexAutoLock lock(mPendingOperationsMutex);
     mPendingOperations.Get((uint32_t)aOperation, getter_AddRefs(operation));
   }
@@ -418,18 +418,17 @@ nsresult nsLDAPConnection::InvokeMessage
 
   // if requested (ie the operation is done), remove the operation
   // from the connection queue.
   if (aRemoveOpFromConnQ) {
     MutexAutoLock lock(mPendingOperationsMutex);
     mPendingOperations.Remove(aOperation);
 
     MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Debug,
-            ("pending operation removed; total pending operations now ="
-             " %d\n",
+            ("pending operation removed; total pending operations now = %d",
              mPendingOperations.Count()));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLDAPConnection::OnLookupComplete(nsICancelable *aRequest,
@@ -489,17 +488,17 @@ nsLDAPConnection::OnLookupComplete(nsICa
         break;
     }
   } else if (!mResolvedIP.Length()) {
     // We have no host resolved, that is very bad, and should most
     // likely have been caught earlier.
     //
     NS_ERROR(
         "nsLDAPConnection::OnStopLookup(): the resolved IP "
-        "string is empty.\n");
+        "string is empty.");
 
     rv = NS_ERROR_UNKNOWN_HOST;
   } else {
     // We've got the IP(s) for the hostname, now lets setup the
     // LDAP connection using this information. Note that if the
     // LDAP server returns a referral, the C-SDK will perform a
     // new, synchronous DNS lookup, which might hang (but hopefully
     // if we've come this far, DNS is working properly).
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -851,21 +851,21 @@ void nsMsgDBService::AddToCache(nsMsgDat
   m_dbCache.AppendElement(pMessageDB);
 }
 
 /**
  * Log the open db's, and how many headers are in memory.
  */
 void nsMsgDBService::DumpCache() {
   nsMsgDatabase *db = nullptr;
-  MOZ_LOG(DBLog, LogLevel::Info, ("%zu open DBs\n", m_dbCache.Length()));
+  MOZ_LOG(DBLog, LogLevel::Info, ("%zu open DBs", m_dbCache.Length()));
   for (uint32_t i = 0; i < m_dbCache.Length(); i++) {
     db = m_dbCache.ElementAt(i);
     MOZ_LOG(DBLog, LogLevel::Info,
-            ("%s - %" PRIu32 " hdrs in use\n",
+            ("%s - %" PRIu32 " hdrs in use",
              db->m_dbFile->HumanReadablePath().get(),
              db->m_headersInUse ? db->m_headersInUse->EntryCount() : 0));
   }
 }
 
 // Memory Reporting implementations
 
 size_t nsMsgDatabase::SizeOfExcludingThis(
@@ -1014,17 +1014,17 @@ nsMsgDatabase::~nsMsgDatabase() {
   delete m_headersInUse;
 
   if (m_msgReferences) {
     delete m_msgReferences;
     m_msgReferences = nullptr;
   }
 
   MOZ_LOG(DBLog, LogLevel::Info,
-          ("closing database    %s\n", m_dbFile->HumanReadablePath().get()));
+          ("closing database    %s", m_dbFile->HumanReadablePath().get()));
 
   nsCOMPtr<nsIMsgDBService> serv(do_GetService(NS_MSGDB_SERVICE_CONTRACTID));
   if (serv) static_cast<nsMsgDBService *>(serv.get())->RemoveFromCache(this);
 
   // if the db folder info refers to the mdb db, we must clear it because
   // the reference will be a dangling one soon.
   if (m_dbFolderInfo) m_dbFolderInfo->ReleaseExternalReferences();
   m_dbFolderInfo = nullptr;
@@ -1068,17 +1068,17 @@ nsresult nsMsgDatabase::Open(nsMsgDBServ
                                      aLeaveInvalidDB,
                                      true /* open synchronously */);
 }
 
 nsresult nsMsgDatabase::OpenInternal(nsMsgDBService *aDBService,
                                      nsIFile *summaryFile, bool aCreate,
                                      bool aLeaveInvalidDB, bool sync) {
   MOZ_LOG(DBLog, LogLevel::Info,
-          ("nsMsgDatabase::Open(%s, %s, %p, %s)\n",
+          ("nsMsgDatabase::Open(%s, %s, %p, %s)",
            summaryFile->HumanReadablePath().get(), aCreate ? "TRUE" : "FALSE",
            this, aLeaveInvalidDB ? "TRUE" : "FALSE"));
 
   nsresult rv = OpenMDB(summaryFile, aCreate, sync);
   if (NS_FAILED(rv))
     MOZ_LOG(DBLog, LogLevel::Info,
             ("error opening db %" PRIx32, static_cast<uint32_t>(rv)));
 
@@ -4005,18 +4005,17 @@ nsIMsgThread *nsMsgDatabase::GetThreadFo
         if (!table) break;
         if (NS_FAILED(rv)) break;
 
         pThread = new nsMsgThread(this, table);
         if (pThread) {
           nsCString curSubject;
           pThread->GetSubject(curSubject);
           if (subject.Equals(curSubject)) {
-            NS_ERROR(
-                "thread with subject exists, but FindRow didn't find it\n");
+            NS_ERROR("thread with subject exists, but FindRow didn't find it");
             break;
           }
         } else
           break;
       }
     }
 #endif
   }
--- a/mailnews/local/src/nsMailboxProtocol.cpp
+++ b/mailnews/local/src/nsMailboxProtocol.cpp
@@ -364,17 +364,17 @@ NS_IMETHODIMP nsMailboxProtocol::OnStopR
   m_nextState = MAILBOX_DONE;
 
   // the following is for smoke test purposes. QA is looking at this "Mailbox
   // Done" string which is printed out to the console and determining if the
   // mail app loaded up correctly...obviously this solution is not very good so
   // we should look at something better, but don't remove this line before
   // talking to me (mscott) and mailnews QA....
 
-  MOZ_LOG(MAILBOX, LogLevel::Info, ("Mailbox Done\n"));
+  MOZ_LOG(MAILBOX, LogLevel::Info, ("Mailbox Done"));
 
   // when on stop binding is called, we as the protocol are done...let's close
   // down the connection releasing all of our interfaces. It's important to
   // remember that this on stop binding call is coming from netlib so they are
   // never going to ping us again with on data available. This means we'll never
   // be going through the Process loop...
 
   if (m_multipleMsgMoveCopyStream) {
--- a/mailnews/local/src/nsMsgMaildirStore.cpp
+++ b/mailnews/local/src/nsMsgMaildirStore.cpp
@@ -242,17 +242,17 @@ NS_IMETHODIMP nsMsgMaildirStore::CreateF
       rv = unusedDB->GetDBFolderInfo(getter_AddRefs(folderInfo));
       if (NS_SUCCEEDED(rv)) folderInfo->SetMailboxName(safeFolderName);
 
       unusedDB->SetSummaryValid(true);
       unusedDB->Close(true);
       aParent->UpdateSummaryTotals(true);
     } else {
       MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
-              ("CreateFolder - failed creating db for new folder\n"));
+              ("CreateFolder - failed creating db for new folder"));
       path->Remove(true);  // recursive
       rv = NS_MSG_CANT_CREATE_FOLDER;
     }
   }
   child.forget(aResult);
   return rv;
 }
 
@@ -589,17 +589,17 @@ nsMsgMaildirStore::GetNewMsgOutputStream
   newFile->Append(NS_LITERAL_STRING("tmp"));
 
   // let's check if the folder exists
   // XXX TODO: kill this and make sure maildir creation includes cur/tmp
   bool exists;
   newFile->Exists(&exists);
   if (!exists) {
     MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
-            ("GetNewMsgOutputStream - tmp subfolder does not exist!!\n"));
+            ("GetNewMsgOutputStream - tmp subfolder does not exist!!"));
     rv = newFile->Create(nsIFile::DIRECTORY_TYPE, 0755);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // Generate the 'tmp' file name based on timestamp.
   // (We'll use the Message-ID as the basis for the final filename,
   // but we don't have headers at this point).
   nsAutoCString newName;
@@ -657,17 +657,17 @@ nsMsgMaildirStore::FinishNewMessage(nsIO
   rv = folder->GetFilePath(getter_AddRefs(folderPath));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // tmp filename is stored in "storeToken".
   // By now we'll have the Message-ID, which we'll base the final filename on.
   nsAutoCString tmpName;
   aNewHdr->GetStringProperty("storeToken", getter_Copies(tmpName));
   if (tmpName.IsEmpty()) {
-    NS_ERROR("FinishNewMessage - no storeToken in msg hdr!!\n");
+    NS_ERROR("FinishNewMessage - no storeToken in msg hdr!!");
     return NS_ERROR_FAILURE;
   }
 
   // path to the new destination
   nsCOMPtr<nsIFile> curPath;
   folderPath->Clone(getter_AddRefs(curPath));
   curPath->Append(NS_LITERAL_STRING("cur"));
 
@@ -772,17 +772,17 @@ nsMsgMaildirStore::MoveNewlyDownloadedMe
   NS_ENSURE_SUCCESS(rv, rv);
   rv = folder->GetFilePath(getter_AddRefs(folderPath));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // file path is stored in message header property
   nsAutoCString fileName;
   aHdr->GetStringProperty("storeToken", getter_Copies(fileName));
   if (fileName.IsEmpty()) {
-    NS_ERROR("FinishNewMessage - no storeToken in msg hdr!!\n");
+    NS_ERROR("FinishNewMessage - no storeToken in msg hdr!!");
     return NS_ERROR_FAILURE;
   }
 
   // path to the downloaded message
   nsCOMPtr<nsIFile> fromPath;
   folderPath->Clone(getter_AddRefs(fromPath));
   fromPath->Append(NS_LITERAL_STRING("cur"));
   fromPath->AppendNative(fileName);
@@ -907,29 +907,29 @@ nsMsgMaildirStore::GetMsgInputStream(nsI
 
   // construct path to file
   nsCOMPtr<nsIFile> path;
   nsresult rv = aMsgFolder->GetFilePath(getter_AddRefs(path));
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aMsgToken.IsEmpty()) {
     MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
-            ("GetMsgInputStream - empty storeToken!!\n"));
+            ("GetMsgInputStream - empty storeToken!!"));
     return NS_ERROR_FAILURE;
   }
 
   path->Append(NS_LITERAL_STRING("cur"));
 
   // let's check if the folder exists
   // XXX TODO: kill this and make sure maildir creation includes cur/tmp
   bool exists;
   path->Exists(&exists);
   if (!exists) {
     MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
-            ("GetMsgInputStream - oops! cur subfolder does not exist!\n"));
+            ("GetMsgInputStream - oops! cur subfolder does not exist!"));
     rv = path->Create(nsIFile::DIRECTORY_TYPE, 0755);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   path->AppendNative(aMsgToken);
   return NS_NewLocalFileInputStream(aResult, path);
 }
 
@@ -946,30 +946,30 @@ NS_IMETHODIMP nsMsgMaildirStore::DeleteM
     nsCOMPtr<nsIFile> path;
     rv = folder->GetFilePath(getter_AddRefs(path));
     NS_ENSURE_SUCCESS(rv, rv);
     nsAutoCString fileName;
     msgHdr->GetStringProperty("storeToken", getter_Copies(fileName));
 
     if (fileName.IsEmpty()) {
       MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
-              ("DeleteMessages - empty storeToken!!\n"));
+              ("DeleteMessages - empty storeToken!!"));
       // Perhaps an offline store has not downloaded this particular message.
       continue;
     }
 
     path->Append(NS_LITERAL_STRING("cur"));
     path->AppendNative(fileName);
 
     // Let's check if the message exists.
     bool exists;
     path->Exists(&exists);
     if (!exists) {
       MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
-              ("DeleteMessages - file does not exist !!\n"));
+              ("DeleteMessages - file does not exist !!"));
       // Perhaps an offline store has not downloaded this particular message.
       continue;
     }
     path->Remove(false);
   }
   return NS_OK;
 }
 
@@ -1047,27 +1047,27 @@ nsMsgMaildirStore::CopyMessages(bool aIs
   NS_ENSURE_SUCCESS(rv, rv);
   uint32_t messageCount;
   rv = aHdrArray->GetLength(&messageCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (uint32_t i = 0; i < messageCount; i++) {
     nsCOMPtr<nsIMsgDBHdr> srcHdr = do_QueryElementAt(aHdrArray, i, &rv);
     if (NS_FAILED(rv)) {
-      MOZ_LOG(MailDirLog, mozilla::LogLevel::Info, ("srcHdr null\n"));
+      MOZ_LOG(MailDirLog, mozilla::LogLevel::Info, ("srcHdr null"));
       continue;
     }
     nsMsgKey srcKey;
     srcHdr->GetMessageKey(&srcKey);
     msgTxn->AddSrcKey(srcKey);
     nsAutoCString fileName;
     srcHdr->GetStringProperty("storeToken", getter_Copies(fileName));
     if (fileName.IsEmpty()) {
       MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
-              ("GetMsgInputStream - empty storeToken!!\n"));
+              ("GetMsgInputStream - empty storeToken!!"));
       return NS_ERROR_FAILURE;
     }
 
     nsCOMPtr<nsIFile> srcFile;
     rv = srcFolderPath->Clone(getter_AddRefs(srcFile));
     NS_ENSURE_SUCCESS(rv, rv);
     srcFile->AppendNative(fileName);
 
--- a/mailnews/mapi/mapihook/src/msgMapiImp.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiImp.cpp
@@ -99,25 +99,25 @@ STDMETHODIMP CMapiImp::Initialize() {
 STDMETHODIMP CMapiImp::Login(unsigned long aUIArg, LPSTR aLogin,
                              LPSTR aPassWord, unsigned long aFlags,
                              unsigned long *aSessionId) {
   HRESULT hr = E_FAIL;
   bool bNewSession = false;
   nsCString id_key;
 
   MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
-          ("CMapiImp::Login using flags %d\n", aFlags));
+          ("CMapiImp::Login using flags %d", aFlags));
   if (aFlags & MAPI_NEW_SESSION) bNewSession = true;
 
   // Check For Profile Name
   if (aLogin != nullptr && aLogin[0] != '\0') {
     if (!nsMapiHook::VerifyUserName(nsDependentCString(aLogin), id_key)) {
       *aSessionId = MAPI_E_LOGIN_FAILURE;
       MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
-              ("CMapiImp::Login failed for username %s\n", aLogin));
+              ("CMapiImp::Login failed for username %s", aLogin));
       NS_ASSERTION(false, "failed verifying user name");
       return hr;
     }
   } else {
     // get default account
     nsresult rv;
     nsCOMPtr<nsIMsgAccountManager> accountManager =
         do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
@@ -152,29 +152,29 @@ STDMETHODIMP CMapiImp::Login(unsigned lo
       return hr;
     }
     case 0: {
       *aSessionId = MAPI_E_INSUFFICIENT_MEMORY;
       return hr;
     }
     default: {
       *aSessionId = nSession_Id;
-      MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("CMapiImp::Login succeeded\n"));
+      MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("CMapiImp::Login succeeded"));
       break;
     }
   }
 
   return S_OK;
 }
 
 STDMETHODIMP CMapiImp::SendMail(unsigned long aSession,
                                 lpnsMapiMessage aMessage, unsigned long aFlags,
                                 unsigned long aReserved) {
   MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
-          ("CMapiImp::SendMail flags=%lx subject: %s sender: %s\n", aFlags,
+          ("CMapiImp::SendMail flags=%lx subject: %s sender: %s", aFlags,
            (aMessage && aMessage->lpszSubject) ? aMessage->lpszSubject
                                                : "(no subject)",
            (aMessage && aMessage->lpOriginator &&
             aMessage->lpOriginator->lpszAddress)
                ? aMessage->lpOriginator->lpszAddress
                : "(no sender)"));
 
   /** create nsIMsgCompFields obj and populate it **/
@@ -199,17 +199,17 @@ STDMETHODIMP CMapiImp::SendMail(unsigned
 }
 
 STDMETHODIMP CMapiImp::SendMailW(unsigned long aSession,
                                  lpnsMapiMessageW aMessage,
                                  unsigned long aFlags,
                                  unsigned long aReserved) {
   MOZ_LOG(
       MAPI, mozilla::LogLevel::Debug,
-      ("CMapiImp::SendMailW flags=%lx subject: %s sender: %s\n", aFlags,
+      ("CMapiImp::SendMailW flags=%lx subject: %s sender: %s", aFlags,
        (aMessage && aMessage->lpszSubject)
            ? NS_ConvertUTF16toUTF8(aMessage->lpszSubject).get()
            : "(no subject)",
        (aMessage && aMessage->lpOriginator &&
         aMessage->lpOriginator->lpszAddress)
            ? NS_ConvertUTF16toUTF8(aMessage->lpOriginator->lpszAddress).get()
            : "(no sender)"));
 
@@ -234,33 +234,33 @@ STDMETHODIMP CMapiImp::SendMailW(unsigne
 }
 
 STDMETHODIMP CMapiImp::SendDocuments(unsigned long aSession, LPSTR aDelimChar,
                                      LPSTR aFilePaths, LPSTR aFileNames,
                                      ULONG aFlags) {
   nsresult rv = NS_OK;
 
   MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
-          ("CMapiImp::SendDocument using flags %d\n", aFlags));
+          ("CMapiImp::SendDocument using flags %d", aFlags));
   /** create nsIMsgCompFields obj and populate it **/
   nsCOMPtr<nsIMsgCompFields> pCompFields =
       do_CreateInstance(NS_MSGCOMPFIELDS_CONTRACTID, &rv);
   if (NS_FAILED(rv) || (!pCompFields)) return MAPI_E_INSUFFICIENT_MEMORY;
 
   if (aFilePaths) {
     rv = nsMapiHook::PopulateCompFieldsForSendDocs(pCompFields, aFlags,
                                                    aDelimChar, aFilePaths);
   }
 
   if (NS_SUCCEEDED(rv))
     rv = nsMapiHook::ShowComposerWindow(aSession, pCompFields);
   else
     MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
-            ("CMapiImp::SendDocument error rv = %lx, paths = %s names = %s\n",
-             rv, aFilePaths, aFileNames));
+            ("CMapiImp::SendDocument error rv = %lx, paths = %s names = %s", rv,
+             aFilePaths, aFileNames));
 
   return nsMAPIConfiguration::GetMAPIErrorFromNSError(rv);
 }
 
 nsresult CMapiImp::GetDefaultInbox(nsIMsgFolder **inboxFolder) {
   // get default account
   nsresult rv;
   nsCOMPtr<nsIMsgAccountManager> accountManager =
@@ -390,28 +390,28 @@ STDMETHODIMP CMapiImp::FindNext(unsigned
     }
 
     //    TRACE("MAPI: ProcessMAPIFindNext() Found message id = %d\n", nextKey);
 
     sprintf((char *)lpszMessageID, "%d", nextKey);
   }
 
   MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
-          ("CMapiImp::FindNext returning key %s\n", (char *)lpszMessageID));
+          ("CMapiImp::FindNext returning key %s", (char *)lpszMessageID));
   return (SUCCESS_SUCCESS);
 }
 
 STDMETHODIMP CMapiImp::ReadMail(unsigned long aSession, unsigned long ulUIParam,
                                 LPSTR lpszMessageID, unsigned long flFlags,
                                 unsigned long ulReserved,
                                 lpnsMapiMessage *lppMessage) {
   nsresult irv;
   nsAutoCString keyString((char *)lpszMessageID);
   MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
-          ("CMapiImp::ReadMail asking for key %s\n", (char *)lpszMessageID));
+          ("CMapiImp::ReadMail asking for key %s", (char *)lpszMessageID));
   nsMsgKey msgKey = keyString.ToInteger(&irv);
   if (NS_FAILED(irv)) {
     NS_ASSERTION(false, "invalid lpszMessageID");
     return MAPI_E_INVALID_MESSAGE;
   }
   MsgMapiListContext *listContext;
   LONG ret = InitContext(aSession, &listContext);
   if (ret != SUCCESS_SUCCESS) {
@@ -586,17 +586,17 @@ lpnsMapiMessage MsgMapiListContext::GetM
         ConvertRecipientsToMapiFormat(parsedToRecips, message->lpRecips,
                                       MAPI_TO);
         ConvertRecipientsToMapiFormat(parsedCCRecips,
                                       &message->lpRecips[numToRecips], MAPI_CC);
       }
 
       MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
               ("MsgMapiListContext::GetMessage flags=%x subject %s date %s "
-               "sender %s\n",
+               "sender %s",
                flFlags, (char *)message->lpszSubject,
                (char *)message->lpszDateReceived, author.get()));
 
       // Convert any body text that we have locally
       if (!(flFlags & MAPI_ENVELOPE_ONLY))
         message->lpszNoteText = (char *)ConvertBodyToMapiFormat(msgHdr);
     }
     if (!(flFlags & (MAPI_PEEK | MAPI_ENVELOPE_ONLY)))
@@ -698,20 +698,19 @@ char *MsgMapiListContext::ConvertBodyToM
     if (NS_FAILED(rv)) break;
     curLine.Append(CRLF);
     // make sure we have room left
     if (bytesCopied + curLine.Length() < msgSize) {
       strcpy(body + bytesCopied, curLine.get());
       bytesCopied += curLine.Length();
     }
   }
-  MOZ_LOG(
-      MAPI, mozilla::LogLevel::Debug,
-      ("ConvertBodyToMapiFormat size=%x allocated size %x body = %100.100s\n",
-       bytesCopied, msgSize + 1, (char *)body));
+  MOZ_LOG(MAPI, mozilla::LogLevel::Debug,
+          ("ConvertBodyToMapiFormat size=%x allocated size %x body = %100.100s",
+           bytesCopied, msgSize + 1, (char *)body));
   body[bytesCopied] = '\0';  // rhp - fix last line garbage...
   return body;
 }
 
 //*****************************************************************************
 // MSGMAPI API implementation
 
 static void msg_FreeMAPIFile(lpMapiFileDesc f) {
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -2707,17 +2707,17 @@ NS_IMETHODIMP
 nsNNTPProtocol::Notify(nsITimer *timer) {
   NS_ASSERTION(timer == mUpdateTimer.get(), "Hey, this ain't my timer!");
   mUpdateTimer = nullptr;  // release my hold
   TimerCallback();
   return NS_OK;
 }
 
 void nsNNTPProtocol::TimerCallback() {
-  MOZ_LOG(NNTP, LogLevel::Info, ("nsNNTPProtocol::TimerCallback\n"));
+  MOZ_LOG(NNTP, LogLevel::Info, ("nsNNTPProtocol::TimerCallback"));
   m_nextState = NNTP_READ_LIST;
 
   // process whatever is already in the buffer at least once.
   //
   // NOTE: while downloading, it would almost be enough to just
   // resume necko since it will call us again with data.  however,
   // if we are at the end of the data stream then we must call
   // ProcessProtocolState since necko will not call us again.