public void diagnostic(String message, final Throwable e) {
final String msg = FORMATTER.format("gwt-log", message);
DeferredCommand.addCommand(new Command() {
public void execute() {
for (Iterator<Logger> iterator = loggers.iterator(); iterator.hasNext();) {
Logger logger = iterator.next();
try {
logger.diagnostic(msg, e);
} catch (RuntimeException e1) {
iterator.remove();
diagnostic(
"Removing '" + logger.getClass().getName() + "' due to unexecpted exception", e1);
}
}
}
});
}