* Creates the default build logger for sending build events to the ant log.
*
* @return the logger instance for this build.
*/
protected BuildLogger createLogger() {
BuildLogger logger = null;
if (configuration.getLoggerClassname() != null) {
try {
logger = (BuildLogger) ClasspathUtils.newInstance(configuration.getLoggerClassname(),
EasyAntEngine.class.getClassLoader(), BuildLogger.class);
} catch (BuildException e) {
throw new RuntimeException("The specified logger class " + configuration.getLoggerClassname()
+ " could not be used because " + e.getMessage(), e);
}
} else {
logger = new DefaultEasyAntLogger();
}
logger.setMessageOutputLevel(configuration.getMsgOutputLevel());
logger.setOutputPrintStream(configuration.getOut());
logger.setErrorPrintStream(configuration.getErr());
logger.setEmacsMode(configuration.isEmacsMode());
return logger;
}