* consider headless environments
This commit is contained in:
parent
baf65babcc
commit
e64d97b222
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue