private void logEvent(BuildEvent event, String additionalMessage) {
String message = event.getMessage();
Throwable exception = event.getException();
Target target = event.getTarget();
Task task = event.getTask();
if (additionalMessage != null) {
this.output.println(additionalMessage);
}
if (target != null) {
String targetName = (target.getName() != null) ? target.getName() : "";
this.output.print("[" + targetName + "] ");
}
if (task != null) {
this.output.print("<" + task.getTaskName() + "> ");
}
if (message != null) {
this.output.print(message);
}