From a4d8a5c33dd58a60bd43e3ada9f61a1b28e67c2b Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 16 Dec 2009 22:12:54 +0000 Subject: [PATCH] Improve message logging git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@884 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index a07849c9..44e80f9d 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -749,7 +749,18 @@ public class ExchangeSession { message.messageId = message.messageId.substring(1, message.messageId.length() - 1); } - LOGGER.debug("Found message IMAP uid: " + message.imapUid + " href: " + responseEntity.getHref() + " permanenturl:" + message.permanentUrl); + if (LOGGER.isDebugEnabled()) { + StringBuilder buffer = new StringBuilder(); + buffer.append("Message"); + if (message.imapUid != 0) { + buffer.append(" IMAP uid: ").append(message.imapUid); + } + if (message.uid != null) { + buffer.append(" uid: ").append(message.uid); + } + buffer.append(" href: ").append(responseEntity.getHref()).append(" permanenturl:").append(message.permanentUrl); + LOGGER.debug(buffer.toString()); + } return message; } @@ -1515,7 +1526,7 @@ public class ExchangeSession { try { write(os, messageUrl); } catch (HttpNotFoundException e) { - LOGGER.debug("Message not found at: "+messageUrl+", retrying with permanenturl"); + LOGGER.debug("Message not found at: " + messageUrl + ", retrying with permanenturl"); write(os, permanentUrl); } }