james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [32/34] james-project git commit: JAMES-2085 Rely more on Log string formatting
Date Wed, 05 Jul 2017 13:59:39 GMT
JAMES-2085 Rely more on Log string formatting


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/550c1c5c
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/550c1c5c
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/550c1c5c

Branch: refs/heads/master
Commit: 550c1c5ccdf977b80fcd237ced87318d40f7c636
Parents: c5758e6
Author: benwa <btellier@linagora.com>
Authored: Wed Jul 5 09:26:59 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Wed Jul 5 17:14:08 2017 +0700

----------------------------------------------------------------------
 .../org/apache/james/mailbox/jpa/migrator/JpaMigrator.java   | 4 ++--
 .../org/apache/james/imap/processor/SearchProcessor.java     | 2 +-
 .../apache/james/imap/processor/fetch/EnvelopeBuilder.java   | 2 +-
 .../apache/james/mailrepository/jcr/JCRMailRepository.java   | 8 +++-----
 .../apache/james/repository/file/AbstractFileRepository.java | 4 ++--
 .../mailetcontainer/lib/AbstractStateMailetProcessor.java    | 4 ++--
 6 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/550c1c5c/mailbox/tool/src/main/java/org/apache/james/mailbox/jpa/migrator/JpaMigrator.java
----------------------------------------------------------------------
diff --git a/mailbox/tool/src/main/java/org/apache/james/mailbox/jpa/migrator/JpaMigrator.java
b/mailbox/tool/src/main/java/org/apache/james/mailbox/jpa/migrator/JpaMigrator.java
index 2eea2e0..a557acc 100644
--- a/mailbox/tool/src/main/java/org/apache/james/mailbox/jpa/migrator/JpaMigrator.java
+++ b/mailbox/tool/src/main/java/org/apache/james/mailbox/jpa/migrator/JpaMigrator.java
@@ -60,11 +60,11 @@ public class JpaMigrator {
 
             for (String jira: jiras) {
                 JpaMigrateCommand jiraJpaMigratable = (JpaMigrateCommand) Class.forName(JPA_MIGRATION_COMMAND_PACKAGE
+ "." + jira.toUpperCase(Locale.US) + JpaMigrateCommand.class.getSimpleName()).newInstance();
-                LOGGER.info("Now executing " + jira + " migration.");
+                LOGGER.info("Now executing {} migration", jira);
                 em.getTransaction().begin();
                 jiraJpaMigratable.migrate(em);
                 em.getTransaction().commit();
-                LOGGER.info(jira + " migration is successfully achieved.");
+                LOGGER.info("{} migration is successfully achieved", jira);
             }
         } catch (Throwable t) {
             throw new JpaMigrateException(t);

http://git-wip-us.apache.org/repos/asf/james-project/blob/550c1c5c/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
index 2b556e4..2713d73 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
@@ -370,7 +370,7 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest>
imp
             long modSeq = key.getModSeq();
             return SearchQuery.or(SearchQuery.modSeqEquals(modSeq), SearchQuery.modSeqGreaterThan(modSeq));
         default:
-            session.getLog().warn("Ignoring unknown search key " + type);
+            session.getLog().warn("Ignoring unknown search key {}", type);
             return SearchQuery.all();
         }
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/550c1c5c/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
index b658d51..1c1eff1 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
@@ -145,7 +145,7 @@ public final class EnvelopeBuilder {
                         addresses.add(mailboxAddress);
 
                     } else {
-                        logger.warn("Unknown address type " + address.getClass());
+                        logger.warn("Unknown address type {}", address.getClass());
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/550c1c5c/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
b/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
index 9e4c7bd..0c76f8d 100644
--- a/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
+++ b/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
@@ -65,8 +65,6 @@ import org.apache.mailet.MailAddress;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import sun.misc.IOUtils;
-
 /**
  * Mail repository that is backed by a JCR content repository.
  */
@@ -618,9 +616,9 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
                         nodes.nextNode().remove();
                     }
                     session.save();
-                    LOGGER.info("Mail " + key + " removed from repository");
+                    LOGGER.info("Mail {} removed from repository", key);
                 } else {
-                    LOGGER.warn("Mail " + key + " not found");
+                    LOGGER.warn("Mail {} not found", key);
                 }
             } finally {
                 session.logout();
@@ -655,7 +653,7 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
                     setMail(node, mail);
                 }
                 session.save();
-                LOGGER.info("Mail " + mail.getName() + " stored in repository");
+                LOGGER.info("Mail {} stored in repository", mail.getName());
             } finally {
                 session.logout();
             }

http://git-wip-us.apache.org/repos/asf/james-project/blob/550c1c5c/server/data/data-library/src/main/java/org/apache/james/repository/file/AbstractFileRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-library/src/main/java/org/apache/james/repository/file/AbstractFileRepository.java
b/server/data/data-library/src/main/java/org/apache/james/repository/file/AbstractFileRepository.java
index 7ceb96d..3f6409e 100644
--- a/server/data/data-library/src/main/java/org/apache/james/repository/file/AbstractFileRepository.java
+++ b/server/data/data-library/src/main/java/org/apache/james/repository/file/AbstractFileRepository.java
@@ -132,9 +132,9 @@ public abstract class AbstractFileRepository implements Repository, Configurable
             File newFile = new File(directory, newFilename);
 
             if (origFile.renameTo(newFile)) {
-                getLogger().info("Renamed " + origFile + " to " + newFile);
+                getLogger().info("Renamed {} to {}", origFile, newFile);
             } else {
-                getLogger().info("Unable to rename " + origFile + " to " + newFile);
+                getLogger().info("Unable to rename {} to {}", origFile, newFile);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/550c1c5c/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
index 1580014..2086e40 100644
--- a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
+++ b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java
@@ -429,8 +429,8 @@ public abstract class AbstractStateMailetProcessor implements MailProcessor,
Con
                 // error processor. That is currently the
                 // normal situation for James, and the message
                 // will show up in the error store.
-                logger.warn("Message " + mail.getName() + " reached the end of this processor,
and is automatically deleted." +
-                    "  This may indicate a configuration error.");
+                logger.warn("Message {} reached the end of this processor, and is automatically
deleted. " +
+                    "This may indicate a configuration error.", mail.getName());
             }
 
             // Set the mail to ghost state


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message