# HG changeset patch # User Jorg K # Date 1556716473 -7200 # Node ID 547dab7a9234941e282c7965b67fa43446bea376 # Parent 7e475f362f399ed5469a1f5404f5ac5f4d49bbd0 Bug 697522 - Follow-up: reformat logging code. rs=reformat DONTBUILD diff --git a/mailnews/local/src/nsParseMailbox.cpp b/mailnews/local/src/nsParseMailbox.cpp --- a/mailnews/local/src/nsParseMailbox.cpp +++ b/mailnews/local/src/nsParseMailbox.cpp @@ -1719,18 +1719,19 @@ nsParseNewMailState::Init(nsIMsgFolder * NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr server; rv = rootMsgFolder->GetServer(getter_AddRefs(server)); if (NS_SUCCEEDED(rv)) { nsString serverName; server->GetPrettyName(serverName); - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Detected new local messages on account '%s'", - NS_ConvertUTF16toUTF8(serverName).get())); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Detected new local messages on account '%s'", + NS_ConvertUTF16toUTF8(serverName).get())); rv = server->GetFilterList(aMsgWindow, getter_AddRefs(m_filterList)); if (m_filterList) rv = server->ConfigureTemporaryFilters(m_filterList); // check if this server defers to another server, in which case // we'll use that server's filters as well. nsCOMPtr deferredToRootFolder; server->GetRootMsgFolder(getter_AddRefs(deferredToRootFolder)); @@ -1946,26 +1947,32 @@ void nsParseNewMailState::ApplyFilters(b if (!downloadFolder) rootMsgFolder->GetFolderWithFlags(nsMsgFolderFlags::Inbox, getter_AddRefs(downloadFolder)); if (downloadFolder) downloadFolder->GetURI(m_inboxUri); char * headers = m_headers.GetBuffer(); uint32_t headersSize = m_headers.GetBufferPos(); if (m_filterList) { - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Running filters on 1 message at offset %" PRIu64, msgOffset)); - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Using filters from the original account")); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Running filters on 1 message at offset %" PRIu64, + msgOffset)); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Using filters from the original account")); (void) m_filterList-> ApplyFiltersToHdr(nsMsgFilterType::InboxRule, msgHdr, downloadFolder, m_mailDB, nsDependentCSubstring(headers, headersSize), this, msgWindow); } if (!m_msgMovedByFilter && m_deferredToServerFilterList) { - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Running filters on 1 message at offset %" PRIu64, msgOffset)); - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Using filters from the deferred to account")); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Running filters on 1 message at offset %" PRIu64, + msgOffset)); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Using filters from the deferred to account")); (void) m_deferredToServerFilterList-> ApplyFiltersToHdr(nsMsgFilterType::InboxRule, msgHdr, downloadFolder, m_mailDB, nsDependentCSubstring(headers, headersSize), this, msgWindow); } } } if (pMoved) *pMoved = m_msgMovedByFilter; @@ -1990,18 +1997,21 @@ NS_IMETHODIMP nsParseNewMailState::Apply uint32_t numActions; rv = filterActionList->GetLength(&numActions); NS_ENSURE_SUCCESS(rv, rv); nsCString msgId; msgHdr->GetMessageId(getter_Copies(msgId)); nsMsgKey msgKey; msgHdr->GetMessageKey(&msgKey); - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Applying filter actions on message with key %" PRIu32, msgKeyToInt(msgKey))); - MOZ_LOG(FILTERLOGMODULE, LogLevel::Debug, ("(Local) Message ID: %s", msgId.get())); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Applying filter actions on message with key %" PRIu32, + msgKeyToInt(msgKey))); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Debug, + ("(Local) Message ID: %s", msgId.get())); bool loggingEnabled = false; if (m_filterList && numActions) m_filterList->GetLoggingEnabled(&loggingEnabled); bool msgIsNew = true; for (uint32_t actionIndex = 0; actionIndex < numActions && *applyMore; actionIndex++) { @@ -2324,17 +2334,20 @@ nsresult nsParseNewMailState::ApplyForwa nsresult rv = NS_OK; nsCOMPtr server; uint32_t i; uint32_t count = m_forwardTo.Length(); nsMsgKey msgKey; if (count > 0 && m_msgToForwardOrReply) { m_msgToForwardOrReply->GetMessageKey(&msgKey); - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Forwarding message with key %" PRIu32 " to %" PRIu32 " addresses", msgKeyToInt(msgKey), count)); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Forwarding message with key %" PRIu32 " to %" PRIu32 + " addresses", + msgKeyToInt(msgKey), count)); } for (i = 0; i < count; i++) { if (!m_forwardTo[i].IsEmpty()) { nsAutoString forwardStr; CopyASCIItoUTF16(m_forwardTo[i], forwardStr); @@ -2343,25 +2356,29 @@ nsresult nsParseNewMailState::ApplyForwa { nsCOMPtr compService = do_GetService (NS_MSGCOMPOSESERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); rv = compService->ForwardMessage(forwardStr, m_msgToForwardOrReply, msgWindow, server, nsIMsgComposeService::kForwardAsDefault); if (NS_FAILED(rv)) - MOZ_LOG(FILTERLOGMODULE, LogLevel::Error, ("(Local) Forwarding failed")); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Error, + ("(Local) Forwarding failed")); } } } m_forwardTo.Clear(); count = m_replyTemplateUri.Length(); if (count > 0 && m_msgToForwardOrReply) { - MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, ("(Local) Replying message with key %" PRIu32 " to %" PRIu32 " addresses", msgKeyToInt(msgKey), count)); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Info, + ("(Local) Replying message with key %" PRIu32 " to %" PRIu32 + " addresses", + msgKeyToInt(msgKey), count)); } for (i = 0; i < count; i++) { if (!m_replyTemplateUri[i].IsEmpty()) { // copy this and truncate the original, so we don't accidentally re-use it on the next hdr. rv = m_rootFolder->GetServer(getter_AddRefs(server)); @@ -2369,17 +2386,18 @@ nsresult nsParseNewMailState::ApplyForwa { nsCOMPtr compService = do_GetService (NS_MSGCOMPOSESERVICE_CONTRACTID) ; if (compService) { rv = compService->ReplyWithTemplate(m_msgToForwardOrReply, m_replyTemplateUri[i].get(), msgWindow, server); if (NS_FAILED(rv)) { NS_WARNING("ReplyWithTemplate failed"); - MOZ_LOG(FILTERLOGMODULE, LogLevel::Error, ("(Local) Replying failed")); + MOZ_LOG(FILTERLOGMODULE, LogLevel::Error, + ("(Local) Replying failed")); if (rv == NS_ERROR_ABORT) { (void) m_filter->LogRuleHitFail(m_ruleAction, m_msgToForwardOrReply, rv, NS_LITERAL_CSTRING("filterFailureSendingReplyAborted")); } else { (void) m_filter->LogRuleHitFail(m_ruleAction, m_msgToForwardOrReply, rv, NS_LITERAL_CSTRING("filterFailureSendingReplyError")); } }