I amtrying to add logging capabilities to my RCP e4 application. I found the following Snippet.
import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.services.log.Logger;
@Creatable
public class LoggerWrapper extends Logger {
@Optional
@Inject
private Logger logger;
@Override
public boolean isErrorEnabled() {
if (logger != null) {
return logger.isErrorEnabled();
}
return false;
}
@Override
public void error(Throwable t, String message) {
if (logger != null && isErrorEnabled()) {
logger.error(t, withPluginInfo(message));
}
}
}
But I am not sure how to configure/initialize the Logger? Any help will be appreciated. Thanks!