* consider headless environments

This commit is contained in:
Reinhard Pointner 2012-07-21 13:55:07 +00:00
parent baf65babcc
commit e64d97b222
1 changed files with 13 additions and 9 deletions

View File

@ -5,6 +5,7 @@ package net.sourceforge.filebot.ui;
import static net.sourceforge.filebot.Settings.*;
import static net.sourceforge.tuned.ui.notification.Direction.*;
import java.awt.GraphicsEnvironment;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
@ -43,7 +44,6 @@ public class NotificationLogging extends Handler {
return log;
}
public final NotificationManager notificationManager;
public final int timeout = 2500;
@ -60,6 +60,10 @@ public class NotificationLogging extends Handler {
@Override
public void publish(LogRecord record) {
// fail gracefully on an headless machine
if (GraphicsEnvironment.isHeadless())
return;
final Level level = record.getLevel();
final String message = getMessage(record);