package org.daisy.maven.xproc.pipeline;

import com.google.common.eventbus.Subscribe;

import org.daisy.common.messaging.Message;
import org.daisy.pipeline.event.EventBusProvider;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;

@Component
public class MessageEventListener {
	
	@Reference(
		name = "EventBusProvider",
		unbind = "-",
		service = EventBusProvider.class,
		cardinality = ReferenceCardinality.MANDATORY,
		policy = ReferencePolicy.STATIC
	)
	public void setEventBusProvider(EventBusProvider provider) {
		provider.get().register(this);
	}
	
	@Subscribe
	public synchronized void handleMessage(Message message) {
		System.out.printf("[%s] %s\n", message.getLevel(), message.getText());
	}
}

@@ -420,16 +420,74 @@
 olicy;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 @Compone
@@ -884,79 +884,386 @@
 %0A%09%09S
-ystem.out.printf(%22%5B%25s%5D %25s%5Cn%22, message.getLevel(), message.getText()
+tring m = message.getText();%0A%09%09switch (message.getLevel()) %7B%0A%09%09case TRACE:%0A%09%09%09logger.trace(m);%0A%09%09%09break;%0A%09%09case DEBUG:%0A%09%09%09logger.debug(m);%0A%09%09%09break;%0A%09%09case INFO:%0A%09%09%09logger.info(m);%0A%09%09%09break;%0A%09%09case WARNING:%0A%09%09%09logger.warn(m);%0A%09%09%09break;%0A%09%09case ERROR:%0A%09%09%09logger.error(m);%0A%09%09%09break; %7D%0A%09%7D%0A%09%0A%09private static final Logger logger = LoggerFactory.getLogger(MessageEventListener.class
 );%0A%09
-%7D
 %0A%7D%0A

Use logback to print job messages