if(compiler.getErrorLog().hasNoErrors())
return new Success<Module>(compiler.getModule());
else {
- LOGGER.error("While compiling " + getModuleName() + ":");
- LOGGER.error(CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors()));
+ if(options == null || !options.silent)
+ LOGGER.error("While compiling " + getModuleName() + ":\n " +
+ CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors()).replaceAll("\n", "\n "));
return new Failure(compiler.getErrorLog().getErrors());
}
} catch (IOException e) {
+ if(options == null || !options.silent)
+ LOGGER.error("Compilation of module " + moduleName + " failed.", e);
return new Failure(e);
}
}