Index: maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/core/AbstractI18nPlugin.java diff -u maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/core/AbstractI18nPlugin.java:1.9 maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/core/AbstractI18nPlugin.java:1.10 --- maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/core/AbstractI18nPlugin.java:1.9 Sat Jan 5 13:04:25 2008 +++ maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/core/AbstractI18nPlugin.java Fri Jan 11 22:56:30 2008 @@ -31,6 +31,7 @@ import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.logging.Log; import org.codelutin.i18n.plugin.util.SortedProperties; +import org.codelutin.util.StringUtil; /** * Classe permettant d'obenir les paramètres pendant les différentes phases @@ -74,6 +75,12 @@ protected boolean keysModifier; /** + * @description verbose + * @parameter expression="${i18n.verbose}" default-value="${maven.verbose}" + */ + protected boolean verbose; + + /** * Log */ protected Log log = getLog(); @@ -121,7 +128,29 @@ propertiesOut.putAll(propertiesIn); propertiesOut.store(new FileOutputStream(out), null); } - + + /** + * Construit une chaine de log formatée. + * + * @param msg le prefix du message + * @param nbFiles le nombre de fichiers actuellement traités + * @param time le time de traitement de ce fichier + * @param all le temps de traitement de tous les fichiers + * @return la chaine de log formatée + */ + protected String getLogEntry(String msg, int nbFiles, long time, long all) { + long now = System.nanoTime(); + long delta = now - time; + String s = getClass().getSimpleName() + " : " + msg; + if (time > 0) { + s += " (" + StringUtil.convertTime(delta) + ")"; + } + if (all > 0 && nbFiles > -1) { + s += "(total time:" + StringUtil.convertTime(now - all) + ") ( ~ " + StringUtil.convertTime(((now - all) / (nbFiles + 1))) + " /file)"; + } + return s; + } + /** Taille du buffer pour les lectures/écritures */ protected static final int BUFFER_SIZE = 8 * 1024; }