mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 08:48:51 -05:00
* 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.filebot.Settings.*;
|
||||||
import static net.sourceforge.tuned.ui.notification.Direction.*;
|
import static net.sourceforge.tuned.ui.notification.Direction.*;
|
||||||
|
|
||||||
|
import java.awt.GraphicsEnvironment;
|
||||||
import java.util.logging.ConsoleHandler;
|
import java.util.logging.ConsoleHandler;
|
||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -43,7 +44,6 @@ public class NotificationLogging extends Handler {
|
|||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public final NotificationManager notificationManager;
|
public final NotificationManager notificationManager;
|
||||||
public final int timeout = 2500;
|
public final int timeout = 2500;
|
||||||
|
|
||||||
@ -60,6 +60,10 @@ public class NotificationLogging extends Handler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void publish(LogRecord record) {
|
public void publish(LogRecord record) {
|
||||||
|
// fail gracefully on an headless machine
|
||||||
|
if (GraphicsEnvironment.isHeadless())
|
||||||
|
return;
|
||||||
|
|
||||||
final Level level = record.getLevel();
|
final Level level = record.getLevel();
|
||||||
final String message = getMessage(record);
|
final String message = getMessage(record);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user