Author: chatellier Date: 2009-09-15 16:45:10 +0000 (Tue, 15 Sep 2009) New Revision: 2625 Modified: isis-fish/trunk/changelog.txt isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/EvaluatorHelper.java Log: Add commons logger in equation Modified: isis-fish/trunk/changelog.txt =================================================================== --- isis-fish/trunk/changelog.txt 2009-09-15 16:44:20 UTC (rev 2624) +++ isis-fish/trunk/changelog.txt 2009-09-15 16:45:10 UTC (rev 2625) @@ -1,6 +1,8 @@ isis-fish (3.2.0.7) stable; urgency=low - * Imporve check region code (null object, invalid names...) + * Add log in equation content + * Fix result names selection problem for current simulation + * Improve check region code (null object, invalid names...) * Refactor storage modifications notification (done for regions) * Fix a little trace util object for both Cache and Trace aspect * Add aspect to get rule time (init/pre/post) in simulation summary Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/EvaluatorHelper.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/EvaluatorHelper.java 2009-09-15 16:44:20 UTC (rev 2624) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/EvaluatorHelper.java 2009-09-15 16:45:10 UTC (rev 2625) @@ -33,6 +33,7 @@ import org.apache.commons.logging.LogFactory; import org.codelutin.util.FileUtil; +import fr.ifremer.isisfish.IsisConfig; import fr.ifremer.isisfish.IsisFishRuntimeException; import fr.ifremer.isisfish.IsisFish; @@ -189,6 +190,18 @@ return result; } + /** + * Generate equation content. + * + * Warning, content are always on a unique single line (without \n) for + * debuging purpose. + * + * @param packageName + * @param className + * @param interfaceMethod + * @param script + * @return equation return + */ protected static String generateContent(String packageName, String className, Method interfaceMethod, String script) { String content = ""; if (packageName != null && !"".equals(packageName)) { @@ -200,11 +213,12 @@ content += "import fr.ifremer.isisfish.types.Month;"; content += "import fr.ifremer.isisfish.types.RangeOfValues;"; content += "import fr.ifremer.isisfish.types.TimeUnit;"; + content += "import org.apache.commons.logging.Log;"; + content += "import org.apache.commons.logging.LogFactory;"; content += "import java.util.*;"; content += "public class " + className + " implements " + interfaceMethod.getDeclaringClass().getName() + " {"; - content += - "public " + interfaceMethod.getReturnType().getName() + - " " + interfaceMethod.getName() + "("; + content += "private static Log log = LogFactory.getLog(" + className + ".class);"; + content += "public " + interfaceMethod.getReturnType().getName() + " " + interfaceMethod.getName() + "("; Args args = interfaceMethod.getAnnotation(Args.class); String [] names = args.value();