Bug 1463266 - remove \n in MOZ_LOG and NS_ERROR. r=me DONTBUILD
authorJorg K <jorgk@jorgk.com>
Sun, 13 Oct 2019 00:42:32 +0200
changeset 37160 7d63ed41d20c46fbbc7bce5ed33b30d7a15e924b
parent 37159 2738f47944c5e1ef169777a72805baae12568dc8
child 37161 3d3db48e3d46f1a18cfc5901efa4b29383ab2f94
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/nsLDAPProtocolModule.cpp
ldap/xpcom/src/nsLDAPSecurityGlue.cpp
ldap/xpcom/src/nsLDAPSyncQuery.cpp
mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
mailnews/addrbook/src/nsDirPrefs.cpp
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/db/msgdb/src/nsMailDatabase.cpp
mailnews/mime/src/nsCMS.cpp
--- a/ldap/xpcom/src/nsLDAPProtocolModule.cpp
+++ b/ldap/xpcom/src/nsLDAPProtocolModule.cpp
@@ -90,29 +90,28 @@ const mozilla::Module::ContractIDEntry k
 
 static nsresult nsLDAPInitialize() {
   // use NSPR under the hood for all networking
   //
   int rv = prldap_install_routines(NULL, 1 /* shared */);
 
   if (rv != LDAP_SUCCESS) {
     MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Error,
-            ("nsLDAPInitialize(): pr_ldap_install_routines() failed: %s\n",
+            ("nsLDAPInitialize(): pr_ldap_install_routines() failed: %s",
              ldap_err2string(rv)));
     return NS_ERROR_FAILURE;
   }
 
   // Never block for more than 10000 milliseconds (ie 10 seconds) doing any
   // sort of I/O operation.
   //
   rv = prldap_set_session_option(0, 0, PRLDAP_OPT_IO_MAX_TIMEOUT, 10000);
   if (rv != LDAP_SUCCESS) {
     MOZ_LOG(gLDAPLogModule, mozilla::LogLevel::Error,
-            ("nsLDAPInitialize(): error setting PRLDAP_OPT_IO_MAX_TIMEOUT:"
-             " %s\n",
+            ("nsLDAPInitialize(): error setting PRLDAP_OPT_IO_MAX_TIMEOUT: %s",
              ldap_err2string(rv)));
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 extern const mozilla::Module kLDAPProtocolModule = {mozilla::Module::kVersion,
--- a/ldap/xpcom/src/nsLDAPSecurityGlue.cpp
+++ b/ldap/xpcom/src/nsLDAPSecurityGlue.cpp
@@ -53,17 +53,17 @@ nsLDAPSSLClose(int s, struct lextiof_soc
   nsLDAPSSLSocketClosure *socketClosure;
   nsLDAPSSLSessionClosure *sessionClosure;
 
   // get the socketInfo associated with this socket
   //
   memset(&socketInfo, 0, sizeof(socketInfo));
   socketInfo.soinfo_size = PRLDAP_SOCKETINFO_SIZE;
   if (prldap_get_socket_info(s, socketarg, &socketInfo) != LDAP_SUCCESS) {
-    NS_ERROR("nsLDAPSSLClose(): prldap_get_socket_info() failed\n");
+    NS_ERROR("nsLDAPSSLClose(): prldap_get_socket_info() failed");
     return -1;
   }
 
   // save off the session closure data in an automatic, since we're going to
   // need to call through it
   //
   socketClosure =
       reinterpret_cast<nsLDAPSSLSocketClosure *>(socketInfo.soinfo_appdata);
@@ -286,17 +286,17 @@ nsresult nsLDAPInstallSSL(LDAP *ld, cons
     nsLDAPSSLFreeSessionClosure(&sessionClosure);
     return NS_ERROR_UNEXPECTED;
   }
 
   // Make a copy of the hostname to pass to AddToSocket later
   //
   sessionClosure->hostname = PL_strdup(aHostName);
   if (!sessionClosure->hostname) {
-    NS_ERROR("nsLDAPInstallSSL(): PL_strdup failed\n");
+    NS_ERROR("nsLDAPInstallSSL(): PL_strdup failed");
     nsLDAPSSLFreeSessionClosure(&sessionClosure);
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   // Override functions
   //
   sessionClosure->realClose = iofns.lextiof_close;
   iofns.lextiof_close = nsLDAPSSLClose;
--- a/ldap/xpcom/src/nsLDAPSyncQuery.cpp
+++ b/ldap/xpcom/src/nsLDAPSyncQuery.cpp
@@ -159,17 +159,17 @@ nsresult nsLDAPSyncQuery::OnLDAPSearchEn
   for (uint32_t i = 0; i < attributes.Length(); i++) {
     // Get the values of this attribute.
     // XXX better failure handling
     nsTArray<nsString> vals;
     rv = aMessage->GetValues("objectClass", vals);
     if (NS_FAILED(rv)) {
       NS_WARNING(
           "nsLDAPSyncQuery:OnLDAPSearchEntry(): "
-          "aMessage->GetValues() failed\n");
+          "aMessage->GetValues() failed");
       FinishLDAPQuery();
       break;
     }
 
     // Store all values of this attribute in the mResults.
     for (uint32_t j = 0; j < vals.Length(); j++) {
       mResults.Append(char16_t('\n'));
       mResults.Append(NS_ConvertUTF8toUTF16(attributes[i]));
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -617,17 +617,17 @@ void nsSeamonkeyProfileMigrator::ReadBra
         rv = branch->GetBoolPref(currPref, &prefBranch->boolValue);
         break;
       case nsIPrefBranch::PREF_INT:
         rv = branch->GetIntPref(currPref, &prefBranch->intValue);
         break;
       default:
         NS_WARNING(
             "Invalid Pref Type in "
-            "nsNetscapeProfileMigratorBase::ReadBranch\n");
+            "nsNetscapeProfileMigratorBase::ReadBranch");
         break;
     }
 
     if (NS_SUCCEEDED(rv)) aPrefs.AppendElement(prefBranch);
   }
 }
 
 void nsSeamonkeyProfileMigrator::WriteBranch(const char* branchName,
@@ -651,17 +651,17 @@ void nsSeamonkeyProfileMigrator::WriteBr
         (void)branch->SetBoolPref(pref->prefName, pref->boolValue);
         break;
       case nsIPrefBranch::PREF_INT:
         (void)branch->SetIntPref(pref->prefName, pref->intValue);
         break;
       default:
         NS_WARNING(
             "Invalid Pref Type in "
-            "nsNetscapeProfileMigratorBase::WriteBranch\n");
+            "nsNetscapeProfileMigratorBase::WriteBranch");
         break;
     }
     free(pref->prefName);
     pref->prefName = nullptr;
     delete pref;
     pref = nullptr;
   }
   aPrefs.Clear();
--- a/mailnews/addrbook/src/nsDirPrefs.cpp
+++ b/mailnews/addrbook/src/nsDirPrefs.cpp
@@ -1325,17 +1325,17 @@ void DIR_SavePrefsForOneServer(DIR_Serve
 }
 
 static void DIR_SaveServerPreferences(nsTArray<DIR_Server *> *wholeList) {
   if (wholeList) {
     nsresult rv;
     nsCOMPtr<nsIPrefBranch> pPref(
         do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     if (NS_FAILED(rv)) {
-      NS_WARNING("DIR_SaveServerPreferences: Failed to get the pref service\n");
+      NS_WARNING("DIR_SaveServerPreferences: Failed to get the pref service");
       return;
     }
 
     int32_t i;
     int32_t count = wholeList->Length();
     DIR_Server *server;
 
     for (i = 0; i < count; i++) {
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -423,17 +423,17 @@ SendOperationListener::OnProgress(uint32
 NS_IMETHODIMP
 SendOperationListener::SetMessageKey(nsMsgKey aKey) {
   MOZ_ASSERT_UNREACHABLE("SendOperationListener::SetMessageKey()");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 SendOperationListener::GetMessageId(nsACString &messageId) {
-  MOZ_ASSERT_UNREACHABLE("SendOperationListener::GetMessageId()\n");
+  MOZ_ASSERT_UNREACHABLE("SendOperationListener::GetMessageId()");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 SendOperationListener::OnStopCopy(nsresult aStatus) {
   if (mSendLater) {
     mSendLater->OnCopyStepFinished(aStatus);
     mSendLater = nullptr;
@@ -686,17 +686,17 @@ nsresult nsMsgSendLater::ReparseDBIfNeed
 }
 
 nsresult nsMsgSendLater::InternalSendMessages(bool aUserInitiated,
                                               nsIMsgIdentity *aIdentity) {
   if (WeAreOffline()) return NS_MSG_ERROR_OFFLINE;
 
   // Protect against being called whilst we're already sending.
   if (mSendingMessages) {
-    NS_ERROR("nsMsgSendLater is already sending messages\n");
+    NS_ERROR("nsMsgSendLater is already sending messages");
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv;
 
   // XXX This code should be set up for multiple unsent folders, however we
   // don't support that at the moment, so for now just assume one folder.
   if (!mMessageFolder) {
--- a/mailnews/db/msgdb/src/nsMailDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMailDatabase.cpp
@@ -38,17 +38,17 @@ nsMailDatabase::~nsMailDatabase() {}
 // it, delete it, and then try to open the db again, prior to reparsing.
 nsresult nsMailDatabase::Open(nsMsgDBService *aDBService, nsIFile *aSummaryFile,
                               bool aCreate, bool aUpgrading) {
 #ifdef DEBUG
   nsString leafName;
   aSummaryFile->GetLeafName(leafName);
   if (!StringEndsWith(leafName, NS_LITERAL_STRING(SUMMARY_SUFFIX),
                       nsCaseInsensitiveStringComparator()))
-    NS_ERROR("non summary file passed into open\n");
+    NS_ERROR("non summary file passed into open");
 #endif
   return nsMsgDatabase::Open(aDBService, aSummaryFile, aCreate, aUpgrading);
 }
 
 NS_IMETHODIMP nsMailDatabase::ForceClosed() {
   m_mdbAllOfflineOpsTable = nullptr;
   return nsMsgDatabase::ForceClosed();
 }
--- a/mailnews/mime/src/nsCMS.cpp
+++ b/mailnews/mime/src/nsCMS.cpp
@@ -69,79 +69,78 @@ NSSCMSSignerInfo *nsCMSMessage::GetTopLe
       (NSSCMSSignedData *)NSS_CMSContentInfo_GetContent(cinfo);
   if (!sigd) return nullptr;
 
   PR_ASSERT(NSS_CMSSignedData_SignerInfoCount(sigd) > 0);
   return NSS_CMSSignedData_GetSignerInfo(sigd, 0);
 }
 
 NS_IMETHODIMP nsCMSMessage::GetSignerEmailAddress(char **aEmail) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-          ("nsCMSMessage::GetSignerEmailAddress\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::GetSignerEmailAddress"));
   NS_ENSURE_ARG(aEmail);
 
   NSSCMSSignerInfo *si = GetTopLevelSignerInfo();
   if (!si) return NS_ERROR_FAILURE;
 
   *aEmail = NSS_CMSSignerInfo_GetSignerEmailAddress(si);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsCMSMessage::GetSignerCommonName(char **aName) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::GetSignerCommonName\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::GetSignerCommonName"));
   NS_ENSURE_ARG(aName);
 
   NSSCMSSignerInfo *si = GetTopLevelSignerInfo();
   if (!si) return NS_ERROR_FAILURE;
 
   *aName = NSS_CMSSignerInfo_GetSignerCommonName(si);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsCMSMessage::ContentIsEncrypted(bool *isEncrypted) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::ContentIsEncrypted\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::ContentIsEncrypted"));
   NS_ENSURE_ARG(isEncrypted);
 
   if (!m_cmsMsg) return NS_ERROR_FAILURE;
 
   *isEncrypted = NSS_CMSMessage_IsEncrypted(m_cmsMsg);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsCMSMessage::ContentIsSigned(bool *isSigned) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::ContentIsSigned\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::ContentIsSigned"));
   NS_ENSURE_ARG(isSigned);
 
   if (!m_cmsMsg) return NS_ERROR_FAILURE;
 
   *isSigned = NSS_CMSMessage_IsSigned(m_cmsMsg);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsCMSMessage::GetSignerCert(nsIX509Cert **scert) {
   NSSCMSSignerInfo *si = GetTopLevelSignerInfo();
   if (!si) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIX509Cert> cert;
   if (si->cert) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::GetSignerCert got signer cert\n"));
+            ("nsCMSMessage::GetSignerCert got signer cert"));
 
     nsCOMPtr<nsIX509CertDB> certdb = do_GetService(NS_X509CERTDB_CONTRACTID);
     nsDependentCSubstring certDER(
         reinterpret_cast<char *>(si->cert->derCert.data),
         si->cert->derCert.len);
     nsresult rv = certdb->ConstructX509(certDER, getter_AddRefs(cert));
     NS_ENSURE_SUCCESS(rv, rv);
   } else {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
             ("nsCMSMessage::GetSignerCert no signer cert, do we have a cert "
-             "list? %s\n",
+             "list? %s",
              (si->certList ? "yes" : "no")));
 
     *scert = nullptr;
   }
 
   cert.forget(scert);
 
   return NS_OK;
@@ -159,28 +158,28 @@ nsCMSMessage::VerifyDetachedSignature(un
 
   return CommonVerifySignature(aDigestData, aDigestDataLen, aDigestType);
 }
 
 nsresult nsCMSMessage::CommonVerifySignature(unsigned char *aDigestData,
                                              uint32_t aDigestDataLen,
                                              int16_t aDigestType) {
   MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-          ("nsCMSMessage::CommonVerifySignature, content level count %d\n",
+          ("nsCMSMessage::CommonVerifySignature, content level count %d",
            NSS_CMSMessage_ContentLevelCount(m_cmsMsg)));
   NSSCMSContentInfo *cinfo = nullptr;
   NSSCMSSignedData *sigd = nullptr;
   NSSCMSSignerInfo *si;
   int32_t nsigners;
   RefPtr<SharedCertVerifier> certVerifier;
   nsresult rv = NS_ERROR_FAILURE;
 
   if (!NSS_CMSMessage_IsSigned(m_cmsMsg)) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CommonVerifySignature - not signed\n"));
+            ("nsCMSMessage::CommonVerifySignature - not signed"));
     return NS_ERROR_CMS_VERIFY_NOT_SIGNED;
   }
 
   cinfo = NSS_CMSMessage_ContentLevel(m_cmsMsg, 0);
   if (cinfo) {
     switch (NSS_CMSContentInfo_GetContentTypeTag(cinfo)) {
       case SEC_OID_PKCS7_SIGNED_DATA:
         sigd = reinterpret_cast<NSSCMSSignedData *>(
@@ -188,26 +187,26 @@ nsresult nsCMSMessage::CommonVerifySigna
         break;
 
       case SEC_OID_PKCS7_ENVELOPED_DATA:
       case SEC_OID_PKCS7_ENCRYPTED_DATA:
       case SEC_OID_PKCS7_DIGESTED_DATA:
       default: {
         MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
                 ("nsCMSMessage::CommonVerifySignature - unexpected "
-                 "ContentTypeTag\n"));
+                 "ContentTypeTag"));
         rv = NS_ERROR_CMS_VERIFY_NO_CONTENT_INFO;
         goto loser;
       }
     }
   }
 
   if (!sigd) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CommonVerifySignature - no content info\n"));
+            ("nsCMSMessage::CommonVerifySignature - no content info"));
     rv = NS_ERROR_CMS_VERIFY_NO_CONTENT_INFO;
     goto loser;
   }
 
   if (aDigestData && aDigestDataLen) {
     SECOidTag oidTag;
     SECItem digest;
     digest.data = aDigestData;
@@ -229,29 +228,29 @@ nsresult nsCMSMessage::CommonVerifySigna
         HASH_GetHashOidTagByHashType(static_cast<HASH_HashType>(aDigestType));
     if (oidTag == SEC_OID_UNKNOWN) {
       rv = NS_ERROR_CMS_VERIFY_BAD_DIGEST;
       goto loser;
     }
 
     if (NSS_CMSSignedData_SetDigestValue(sigd, oidTag, &digest)) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - bad digest\n"));
+              ("nsCMSMessage::CommonVerifySignature - bad digest"));
       rv = NS_ERROR_CMS_VERIFY_BAD_DIGEST;
       goto loser;
     }
   }
 
   // Import certs. Note that import failure is not a signature verification
   // failure. //
   if (NSS_CMSSignedData_ImportCerts(sigd, CERT_GetDefaultCertDB(),
                                     certUsageEmailRecipient,
                                     true) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CommonVerifySignature - can not import certs\n"));
+            ("nsCMSMessage::CommonVerifySignature - can not import certs"));
   }
 
   nsigners = NSS_CMSSignedData_SignerInfoCount(sigd);
   PR_ASSERT(nsigners > 0);
   NS_ENSURE_TRUE(nsigners > 0, NS_ERROR_UNEXPECTED);
   si = NSS_CMSSignedData_GetSignerInfo(sigd, 0);
 
   // See bug 324474. We want to make sure the signing cert is
@@ -265,84 +264,83 @@ nsresult nsCMSMessage::CommonVerifySigna
     mozilla::pkix::Result result = certVerifier->VerifyCert(
         si->cert, certificateUsageEmailSigner, Now(), nullptr /*XXX pinarg*/,
         nullptr /*hostname*/, builtChain,
         // Only local checks can run on the main thread.
         CertVerifier::FLAG_LOCAL_ONLY);
     if (result != mozilla::pkix::Success) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
               ("nsCMSMessage::CommonVerifySignature - signing cert not trusted "
-               "now\n"));
+               "now"));
       rv = NS_ERROR_CMS_VERIFY_UNTRUSTED;
       goto loser;
     }
   }
 
   // We verify the first signer info,  only //
   // XXX: NSS_CMSSignedData_VerifySignerInfo calls CERT_VerifyCert, which
   // requires NSS's certificate verification configuration to be done in
   // order to work well (e.g. honoring OCSP preferences and proxy settings
   // for OCSP requests), but Gecko stopped doing that configuration. Something
   // similar to what was done for Gecko bug 1028643 needs to be done here too.
   if (NSS_CMSSignedData_VerifySignerInfo(sigd, 0, CERT_GetDefaultCertDB(),
                                          certUsageEmailSigner) != SECSuccess) {
     MOZ_LOG(
         gPIPNSSLog, LogLevel::Debug,
-        ("nsCMSMessage::CommonVerifySignature - unable to verify signature\n"));
+        ("nsCMSMessage::CommonVerifySignature - unable to verify signature"));
 
     if (NSSCMSVS_SigningCertNotFound == si->verificationStatus) {
-      MOZ_LOG(
-          gPIPNSSLog, LogLevel::Debug,
-          ("nsCMSMessage::CommonVerifySignature - signing cert not found\n"));
+      MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
+              ("nsCMSMessage::CommonVerifySignature - signing cert not found"));
       rv = NS_ERROR_CMS_VERIFY_NOCERT;
     } else if (NSSCMSVS_SigningCertNotTrusted == si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
               ("nsCMSMessage::CommonVerifySignature - signing cert not trusted "
-               "at signing time\n"));
+               "at signing time"));
       rv = NS_ERROR_CMS_VERIFY_UNTRUSTED;
     } else if (NSSCMSVS_Unverified == si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - can not verify\n"));
+              ("nsCMSMessage::CommonVerifySignature - can not verify"));
       rv = NS_ERROR_CMS_VERIFY_ERROR_UNVERIFIED;
     } else if (NSSCMSVS_ProcessingError == si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - processing error\n"));
+              ("nsCMSMessage::CommonVerifySignature - processing error"));
       rv = NS_ERROR_CMS_VERIFY_ERROR_PROCESSING;
     } else if (NSSCMSVS_BadSignature == si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - bad signature\n"));
+              ("nsCMSMessage::CommonVerifySignature - bad signature"));
       rv = NS_ERROR_CMS_VERIFY_BAD_SIGNATURE;
     } else if (NSSCMSVS_DigestMismatch == si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - digest mismatch\n"));
+              ("nsCMSMessage::CommonVerifySignature - digest mismatch"));
       rv = NS_ERROR_CMS_VERIFY_DIGEST_MISMATCH;
     } else if (NSSCMSVS_SignatureAlgorithmUnknown == si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - algo unknown\n"));
+              ("nsCMSMessage::CommonVerifySignature - algo unknown"));
       rv = NS_ERROR_CMS_VERIFY_UNKNOWN_ALGO;
     } else if (NSSCMSVS_SignatureAlgorithmUnsupported ==
                si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - algo not supported\n"));
+              ("nsCMSMessage::CommonVerifySignature - algo not supported"));
       rv = NS_ERROR_CMS_VERIFY_UNSUPPORTED_ALGO;
     } else if (NSSCMSVS_MalformedSignature == si->verificationStatus) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CommonVerifySignature - malformed signature\n"));
+              ("nsCMSMessage::CommonVerifySignature - malformed signature"));
       rv = NS_ERROR_CMS_VERIFY_MALFORMED_SIGNATURE;
     }
 
     goto loser;
   }
 
   // Save the profile. Note that save import failure is not a signature
   // verification failure. //
   if (NSS_SMIMESignerInfo_SaveSMIMEProfile(si) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
             ("nsCMSMessage::CommonVerifySignature - unable to save smime "
-             "profile\n"));
+             "profile"));
   }
 
   rv = NS_OK;
 loser:
   return rv;
 }
 
 NS_IMETHODIMP nsCMSMessage::AsyncVerifySignature(
@@ -473,17 +471,17 @@ class nsZeroTerminatedCertArray {
 
  private:
   CERTCertificate **mCerts;
   PLArenaPool *mPoolp;
   uint32_t mSize;
 };
 
 NS_IMETHODIMP nsCMSMessage::CreateEncrypted(nsIArray *aRecipientCerts) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::CreateEncrypted\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::CreateEncrypted"));
   NSSCMSContentInfo *cinfo;
   NSSCMSEnvelopedData *envd;
   NSSCMSRecipientInfo *recipientInfo;
   nsZeroTerminatedCertArray recipientCerts;
   SECOidTag bulkAlgTag;
   int keySize;
   uint32_t i;
   nsresult rv = NS_ERROR_FAILURE;
@@ -506,66 +504,65 @@ NS_IMETHODIMP nsCMSMessage::CreateEncryp
     recipientCerts.set(i, c.get());
   }
 
   // Find a bulk key algorithm //
   if (NSS_SMIMEUtil_FindBulkAlgForRecipients(
           recipientCerts.getRawArray(), &bulkAlgTag, &keySize) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
             ("nsCMSMessage::CreateEncrypted - can't find bulk alg for "
-             "recipients\n"));
+             "recipients"));
     rv = NS_ERROR_CMS_ENCRYPT_NO_BULK_ALG;
     goto loser;
   }
 
   m_cmsMsg = NSS_CMSMessage_Create(nullptr);
   if (!m_cmsMsg) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateEncrypted - can't create new cms message\n"));
+            ("nsCMSMessage::CreateEncrypted - can't create new cms message"));
     rv = NS_ERROR_OUT_OF_MEMORY;
     goto loser;
   }
 
   if ((envd = NSS_CMSEnvelopedData_Create(m_cmsMsg, bulkAlgTag, keySize)) ==
       nullptr) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateEncrypted - can't create enveloped data\n"));
+            ("nsCMSMessage::CreateEncrypted - can't create enveloped data"));
     goto loser;
   }
 
   cinfo = NSS_CMSMessage_GetContentInfo(m_cmsMsg);
   if (NSS_CMSContentInfo_SetContent_EnvelopedData(m_cmsMsg, cinfo, envd) !=
       SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
             ("nsCMSMessage::CreateEncrypted - can't create content enveloped "
-             "data\n"));
+             "data"));
     goto loser;
   }
 
   cinfo = NSS_CMSEnvelopedData_GetContentInfo(envd);
   if (NSS_CMSContentInfo_SetContent_Data(m_cmsMsg, cinfo, nullptr, false) !=
       SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateEncrypted - can't set content data\n"));
+            ("nsCMSMessage::CreateEncrypted - can't set content data"));
     goto loser;
   }
 
   // Create and attach recipient information //
   for (i = 0; i < recipientCertCount; i++) {
     UniqueCERTCertificate rc(recipientCerts.get(i));
     if ((recipientInfo = NSS_CMSRecipientInfo_Create(m_cmsMsg, rc.get())) ==
         nullptr) {
-      MOZ_LOG(
-          gPIPNSSLog, LogLevel::Debug,
-          ("nsCMSMessage::CreateEncrypted - can't create recipient info\n"));
+      MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
+              ("nsCMSMessage::CreateEncrypted - can't create recipient info"));
       goto loser;
     }
     if (NSS_CMSEnvelopedData_AddRecipient(envd, recipientInfo) != SECSuccess) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CreateEncrypted - can't add recipient info\n"));
+              ("nsCMSMessage::CreateEncrypted - can't add recipient info"));
       goto loser;
     }
   }
 
   return NS_OK;
 loser:
   if (m_cmsMsg) {
     NSS_CMSMessage_Destroy(m_cmsMsg);
@@ -587,17 +584,17 @@ bool nsCMSMessage::IsAllowedHash(const i
   }
 }
 
 NS_IMETHODIMP
 nsCMSMessage::CreateSigned(nsIX509Cert *aSigningCert, nsIX509Cert *aEncryptCert,
                            unsigned char *aDigestData, uint32_t aDigestDataLen,
                            int16_t aDigestType) {
   NS_ENSURE_ARG(aSigningCert);
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::CreateSigned\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSMessage::CreateSigned"));
   NSSCMSContentInfo *cinfo;
   NSSCMSSignedData *sigd;
   NSSCMSSignerInfo *signerinfo;
   UniqueCERTCertificate scert(aSigningCert->GetCert());
   UniqueCERTCertificate ecert;
   nsresult rv = NS_ERROR_FAILURE;
 
   if (!scert) {
@@ -620,123 +617,123 @@ nsCMSMessage::CreateSigned(nsIX509Cert *
 
   /*
    * create the message object
    */
   m_cmsMsg =
       NSS_CMSMessage_Create(nullptr); /* create a message on its own pool */
   if (!m_cmsMsg) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't create new message\n"));
+            ("nsCMSMessage::CreateSigned - can't create new message"));
     rv = NS_ERROR_OUT_OF_MEMORY;
     goto loser;
   }
 
   /*
    * build chain of objects: message->signedData->data
    */
   if ((sigd = NSS_CMSSignedData_Create(m_cmsMsg)) == nullptr) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't create signed data\n"));
+            ("nsCMSMessage::CreateSigned - can't create signed data"));
     goto loser;
   }
   cinfo = NSS_CMSMessage_GetContentInfo(m_cmsMsg);
   if (NSS_CMSContentInfo_SetContent_SignedData(m_cmsMsg, cinfo, sigd) !=
       SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't set content signed data\n"));
+            ("nsCMSMessage::CreateSigned - can't set content signed data"));
     goto loser;
   }
 
   cinfo = NSS_CMSSignedData_GetContentInfo(sigd);
 
   /* we're always passing data in and detaching optionally */
   if (NSS_CMSContentInfo_SetContent_Data(m_cmsMsg, cinfo, nullptr, true) !=
       SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't set content data\n"));
+            ("nsCMSMessage::CreateSigned - can't set content data"));
     goto loser;
   }
 
   /*
    * create & attach signer information
    */
   signerinfo = NSS_CMSSignerInfo_Create(m_cmsMsg, scert.get(), digestType);
   if (!signerinfo) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't create signer info\n"));
+            ("nsCMSMessage::CreateSigned - can't create signer info"));
     goto loser;
   }
 
   /* we want the cert chain included for this one */
   if (NSS_CMSSignerInfo_IncludeCerts(signerinfo, NSSCMSCM_CertChain,
                                      certUsageEmailSigner) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't include signer cert chain\n"));
+            ("nsCMSMessage::CreateSigned - can't include signer cert chain"));
     goto loser;
   }
 
   if (NSS_CMSSignerInfo_AddSigningTime(signerinfo, PR_Now()) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't add signing time\n"));
+            ("nsCMSMessage::CreateSigned - can't add signing time"));
     goto loser;
   }
 
   if (NSS_CMSSignerInfo_AddSMIMECaps(signerinfo) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't add smime caps\n"));
+            ("nsCMSMessage::CreateSigned - can't add smime caps"));
     goto loser;
   }
 
   if (ecert) {
     if (NSS_CMSSignerInfo_AddSMIMEEncKeyPrefs(
             signerinfo, ecert.get(), CERT_GetDefaultCertDB()) != SECSuccess) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CreateSigned - can't add smime enc key prefs\n"));
+              ("nsCMSMessage::CreateSigned - can't add smime enc key prefs"));
       goto loser;
     }
 
     if (NSS_CMSSignerInfo_AddMSSMIMEEncKeyPrefs(
             signerinfo, ecert.get(), CERT_GetDefaultCertDB()) != SECSuccess) {
       MOZ_LOG(
           gPIPNSSLog, LogLevel::Debug,
-          ("nsCMSMessage::CreateSigned - can't add MS smime enc key prefs\n"));
+          ("nsCMSMessage::CreateSigned - can't add MS smime enc key prefs"));
       goto loser;
     }
 
     // If signing and encryption cert are identical, don't add it twice.
     bool addEncryptionCert =
         (ecert && (!scert || !CERT_CompareCerts(ecert.get(), scert.get())));
 
     if (addEncryptionCert &&
         NSS_CMSSignedData_AddCertificate(sigd, ecert.get()) != SECSuccess) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
               ("nsCMSMessage::CreateSigned - can't add own encryption "
-               "certificate\n"));
+               "certificate"));
       goto loser;
     }
   }
 
   if (NSS_CMSSignedData_AddSignerInfo(sigd, signerinfo) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSMessage::CreateSigned - can't add signer info\n"));
+            ("nsCMSMessage::CreateSigned - can't add signer info"));
     goto loser;
   }
 
   // Finally, add the pre-computed digest if passed in
   if (aDigestData) {
     SECItem digest;
 
     digest.data = aDigestData;
     digest.len = aDigestDataLen;
 
     if (NSS_CMSSignedData_SetDigestValue(sigd, digestType, &digest) !=
         SECSuccess) {
       MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-              ("nsCMSMessage::CreateSigned - can't set digest value\n"));
+              ("nsCMSMessage::CreateSigned - can't set digest value"));
       goto loser;
     }
   }
 
   return NS_OK;
 loser:
   if (m_cmsMsg) {
     NSS_CMSMessage_Destroy(m_cmsMsg);
@@ -762,38 +759,38 @@ void nsCMSDecoder::destructorSafeDestroy
   if (m_dcx) {
     NSS_CMSDecoder_Cancel(m_dcx);
     m_dcx = nullptr;
   }
 }
 
 /* void start (in NSSCMSContentCallback cb, in voidPtr arg); */
 NS_IMETHODIMP nsCMSDecoder::Start(NSSCMSContentCallback cb, void *arg) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSDecoder::Start\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSDecoder::Start"));
   m_ctx = new PipUIContext();
 
   m_dcx = NSS_CMSDecoder_Start(0, cb, arg, 0, m_ctx, 0, 0);
   if (!m_dcx) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSDecoder::Start - can't start decoder\n"));
+            ("nsCMSDecoder::Start - can't start decoder"));
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
 /* void update (in string bug, in long len); */
 NS_IMETHODIMP nsCMSDecoder::Update(const char *buf, int32_t len) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSDecoder::Update\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSDecoder::Update"));
   NSS_CMSDecoder_Update(m_dcx, (char *)buf, len);
   return NS_OK;
 }
 
 /* void finish (); */
 NS_IMETHODIMP nsCMSDecoder::Finish(nsICMSMessage **aCMSMsg) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSDecoder::Finish\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSDecoder::Finish"));
   NSSCMSMessage *cmsMsg;
   cmsMsg = NSS_CMSDecoder_Finish(m_dcx);
   m_dcx = nullptr;
   if (cmsMsg) {
     nsCMSMessage *obj = new nsCMSMessage(cmsMsg);
     // The NSS object cmsMsg still carries a reference to the context
     // we gave it on construction.
     // Make sure the context will live long enough.
@@ -818,51 +815,51 @@ nsresult nsCMSEncoder::Init() {
 
 void nsCMSEncoder::destructorSafeDestroyNSSReference() {
   if (m_ecx) NSS_CMSEncoder_Cancel(m_ecx);
 }
 
 /* void start (); */
 NS_IMETHODIMP nsCMSEncoder::Start(nsICMSMessage *aMsg, NSSCMSContentCallback cb,
                                   void *arg) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Start\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Start"));
   nsCMSMessage *cmsMsg = static_cast<nsCMSMessage *>(aMsg);
   m_ctx = new PipUIContext();
 
   m_ecx = NSS_CMSEncoder_Start(cmsMsg->getCMS(), cb, arg, 0, 0, 0, m_ctx, 0, 0,
                                0, 0);
   if (!m_ecx) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSEncoder::Start - can't start encoder\n"));
+            ("nsCMSEncoder::Start - can't start encoder"));
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
 /* void update (in string aBuf, in long aLen); */
 NS_IMETHODIMP nsCMSEncoder::Update(const char *aBuf, int32_t aLen) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Update\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Update"));
   if (!m_ecx || NSS_CMSEncoder_Update(m_ecx, aBuf, aLen) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSEncoder::Update - can't update encoder\n"));
+            ("nsCMSEncoder::Update - can't update encoder"));
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
 /* void finish (); */
 NS_IMETHODIMP nsCMSEncoder::Finish() {
   nsresult rv = NS_OK;
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Finish\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Finish"));
   if (!m_ecx || NSS_CMSEncoder_Finish(m_ecx) != SECSuccess) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("nsCMSEncoder::Finish - can't finish encoder\n"));
+            ("nsCMSEncoder::Finish - can't finish encoder"));
     rv = NS_ERROR_FAILURE;
   }
   m_ecx = nullptr;
   return rv;
 }
 
 /* void encode (in nsICMSMessage aMsg); */
 NS_IMETHODIMP nsCMSEncoder::Encode(nsICMSMessage *aMsg) {
-  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Encode\n"));
+  MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsCMSEncoder::Encode"));
   return NS_ERROR_NOT_IMPLEMENTED;
 }