@@ -0,0 +1,2038 @@
+package fr.lip6.veca.ide.generator;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.time.LocalDateTime;%0A%0A// a simple logger%0A// because making an Eclipse plugin work with log4j and write in the console seem quite complicated ...%0Apublic class Logger %7B%0A%09%0A%09private static final String INFO_REPR = %22%3E INFO: %25s%22;%0A%09private static final String WARNING_REPR = %22%3E WARNING: %25s%22;%0A%09private static final String ERROR_REPR = %22%3E ERROR: %25s%22;%0A%09private static final String DATETIME_REPR = %22%25s%22;%0A%09%0A%09private StringBuilder log;%0A%09%0A%09public Logger() %7B%0A%09%09log = new StringBuilder();%0A%09%7D%0A%09%0A%09public void reset() %7B%0A%09%09log = new StringBuilder();%0A%09%7D%0A%09%0A%09public void append(String repr, String msg, boolean withDateTime) %7B%0A%09%09if (withDateTime)%0A%09%09%09log.append(String.format(DATETIME_REPR + repr + %22%5Cn%22, LocalDateTime.now(), msg));%0A%09%09else%0A%09%09%09log.append(String.format(repr +%22%5Cn%22,  msg));%0A%09%7D%0A%09%0A%09public void append(String repr, InputStream stream, boolean withDateTime) %7B%0A%09%09append(repr, %22%22, withDateTime);%0A%09%09BufferedReader reader = new BufferedReader(new InputStreamReader(stream));%0A%09%09String line = %22%22;%0A%09%09try %7B%0A%09%09%09while((line = reader.readLine()) != null)%0A%09%09%09%09append(%22%5Ct%25s%22, line, false);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09error(e.toString(), true);%0A%09%09%7D%0A%09%7D%0A%09%0A%09public void info(String msg, boolean withDateTime) %7B%0A%09%09this.append(INFO_REPR, msg, withDateTime);%0A%09%7D%0A%0A%09public void warning(String msg, boolean withDateTime) %7B%0A%09%09this.append(WARNING_REPR, msg, withDateTime);%0A%09%7D%0A%0A%09public void error(String msg, boolean withDateTime) %7B%0A%09%09this.append(ERROR_REPR, msg, withDateTime);%0A%09%7D%0A%09%0A%09public void info(InputStream stream, boolean withDateTime) %7B%0A%09%09this.append(INFO_REPR, stream, withDateTime);%0A%09%7D%0A%0A%09public void warning(InputStream stream, boolean withDateTime) %7B%0A%09%09this.append(WARNING_REPR, stream, withDateTime);%0A%09%7D%0A%0A%09public void error(InputStream stream, boolean withDateTime) %7B%0A%09%09this.append(ERROR_REPR, stream, withDateTime);%0A%09%7D%0A%09%0A%09@Override%0A%09public String toString() %7B%0A%09%09return log.toString();%0A%09%7D%0A%0A%7D%0A

add a simple logger (because Eclipse+log4j is a pain)