Unify gui/console logging
This commit is contained in:
parent
63fd9d77af
commit
2f76465c38
@ -48,9 +48,9 @@ public final class Logging {
|
|||||||
// print messages
|
// print messages
|
||||||
out.print(getFormatter().format(record));
|
out.print(getFormatter().format(record));
|
||||||
|
|
||||||
Throwable t = record.getThrown();
|
Throwable thrown = record.getThrown();
|
||||||
if (t != null) {
|
if (thrown != null) {
|
||||||
StackTraceUtils.deepSanitize(t).printStackTrace(out);
|
StackTraceUtils.deepSanitize(thrown).printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
// flush every message immediately
|
// flush every message immediately
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.filebot;
|
package net.filebot;
|
||||||
|
|
||||||
import static java.awt.GraphicsEnvironment.*;
|
import static java.awt.GraphicsEnvironment.*;
|
||||||
|
import static java.util.Arrays.*;
|
||||||
import static java.util.stream.Collectors.*;
|
import static java.util.stream.Collectors.*;
|
||||||
import static javax.swing.JOptionPane.*;
|
import static javax.swing.JOptionPane.*;
|
||||||
import static net.filebot.Logging.*;
|
import static net.filebot.Logging.*;
|
||||||
@ -14,6 +15,7 @@ import java.awt.Dialog.ModalityType;
|
|||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
@ -30,7 +32,8 @@ import java.security.ProtectionDomain;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.stream.Stream;
|
import java.util.logging.StreamHandler;
|
||||||
|
import java.util.logging.XMLFormatter;
|
||||||
|
|
||||||
import javax.swing.JDialog;
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
@ -48,6 +51,7 @@ import net.filebot.mac.MacAppUtilities;
|
|||||||
import net.filebot.ui.FileBotMenuBar;
|
import net.filebot.ui.FileBotMenuBar;
|
||||||
import net.filebot.ui.GettingStartedStage;
|
import net.filebot.ui.GettingStartedStage;
|
||||||
import net.filebot.ui.MainFrame;
|
import net.filebot.ui.MainFrame;
|
||||||
|
import net.filebot.ui.NotificationLogging;
|
||||||
import net.filebot.ui.PanelBuilder;
|
import net.filebot.ui.PanelBuilder;
|
||||||
import net.filebot.ui.SinglePanelFrame;
|
import net.filebot.ui.SinglePanelFrame;
|
||||||
import net.filebot.ui.transfer.FileTransferable;
|
import net.filebot.ui.transfer.FileTransferable;
|
||||||
@ -86,7 +90,7 @@ public class Main {
|
|||||||
if (args.clearCache()) {
|
if (args.clearCache()) {
|
||||||
log.info("Clear cache and temporary files");
|
log.info("Clear cache and temporary files");
|
||||||
for (File folder : getChildren(getApplicationFolder().getCanonicalFile(), FOLDERS)) {
|
for (File folder : getChildren(getApplicationFolder().getCanonicalFile(), FOLDERS)) {
|
||||||
log.config("* Delete " + folder);
|
log.info("* Delete " + folder);
|
||||||
delete(folder);
|
delete(folder);
|
||||||
}
|
}
|
||||||
CacheManager.getInstance().clearAll();
|
CacheManager.getInstance().clearAll();
|
||||||
@ -149,15 +153,7 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GUI mode => start user interface
|
// GUI mode => start user interface
|
||||||
SwingUtilities.invokeAndWait(() -> {
|
SwingUtilities.invokeAndWait(() -> startUserInterface(args));
|
||||||
try {
|
|
||||||
// use native laf an all platforms
|
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.getLogger(Main.class.getName()).log(Level.WARNING, e.getMessage(), e);
|
|
||||||
}
|
|
||||||
startUserInterface(args);
|
|
||||||
});
|
|
||||||
|
|
||||||
// preload media.types (when loaded during DnD it will freeze the UI for a few hundred milliseconds)
|
// preload media.types (when loaded during DnD it will freeze the UI for a few hundred milliseconds)
|
||||||
MediaTypes.getDefault();
|
MediaTypes.getDefault();
|
||||||
@ -191,14 +187,23 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void startUserInterface(ArgumentBean args) {
|
private static void startUserInterface(ArgumentBean args) {
|
||||||
JFrame frame = null;
|
try {
|
||||||
|
// GUI logging settings
|
||||||
|
log.addHandler(new NotificationLogging(getApplicationName()));
|
||||||
|
log.addHandler(new StreamHandler(new FileOutputStream(new File(getApplicationFolder(), "error.log.xml"), true), new XMLFormatter()));
|
||||||
|
|
||||||
if (args.mode == null) {
|
// use native LaF an all platforms
|
||||||
// default frame
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
frame = new MainFrame(MainFrame.createPanelBuilders());
|
} catch (Exception e) {
|
||||||
} else {
|
debug.log(Level.WARNING, e.getMessage(), e);
|
||||||
// single panel frame
|
}
|
||||||
PanelBuilder[] selection = Stream.of(MainFrame.createPanelBuilders()).filter(p -> p.getName().matches(args.mode)).toArray(PanelBuilder[]::new);
|
|
||||||
|
// default frame
|
||||||
|
JFrame frame = new MainFrame(MainFrame.createPanelBuilders());
|
||||||
|
|
||||||
|
// single panel frame
|
||||||
|
if (args.mode != null) {
|
||||||
|
PanelBuilder[] selection = stream(MainFrame.createPanelBuilders()).filter(p -> p.getName().matches(args.mode)).toArray(PanelBuilder[]::new);
|
||||||
if (selection.length == 1) {
|
if (selection.length == 1) {
|
||||||
frame = new SinglePanelFrame(selection[0]).publish(new FileTransferable(args.getFiles(false)));
|
frame = new SinglePanelFrame(selection[0]).publish(new FileTransferable(args.getFiles(false)));
|
||||||
} else if (selection.length > 1) {
|
} else if (selection.length > 1) {
|
||||||
@ -222,7 +227,7 @@ public class Main {
|
|||||||
public void windowClosing(WindowEvent e) {
|
public void windowClosing(WindowEvent e) {
|
||||||
e.getWindow().setVisible(false);
|
e.getWindow().setVisible(false);
|
||||||
|
|
||||||
// make sure any long running operations are done now and not later on the shutdownhook thread
|
// make sure any long running operations are done now and not later on the shutdown hook thread
|
||||||
HistorySpooler.getInstance().commit();
|
HistorySpooler.getInstance().commit();
|
||||||
|
|
||||||
// show donation / review reminders to power users (more than 2000 renames)
|
// show donation / review reminders to power users (more than 2000 renames)
|
||||||
@ -250,7 +255,8 @@ public class Main {
|
|||||||
// Ubuntu specific configuration
|
// Ubuntu specific configuration
|
||||||
String options = System.getenv("JAVA_TOOL_OPTIONS");
|
String options = System.getenv("JAVA_TOOL_OPTIONS");
|
||||||
if (options != null && options.contains("jayatanaag.jar")) {
|
if (options != null && options.contains("jayatanaag.jar")) {
|
||||||
frame.setJMenuBar(FileBotMenuBar.createHelp()); // menu should be rendered via JAyatana on Ubuntu 15.04 and higher
|
// menu should be rendered via JAyatana on Ubuntu 15.04 and higher
|
||||||
|
frame.setJMenuBar(FileBotMenuBar.createHelp());
|
||||||
}
|
}
|
||||||
frame.setIconImages(ResourceManager.getApplicationIcons());
|
frame.setIconImages(ResourceManager.getApplicationIcons());
|
||||||
} else {
|
} else {
|
||||||
|
@ -2,9 +2,9 @@ package net.filebot.mac;
|
|||||||
|
|
||||||
import static java.util.Collections.*;
|
import static java.util.Collections.*;
|
||||||
import static javax.swing.BorderFactory.*;
|
import static javax.swing.BorderFactory.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.UserFiles.*;
|
import static net.filebot.UserFiles.*;
|
||||||
import static net.filebot.mac.MacAppUtilities.*;
|
import static net.filebot.mac.MacAppUtilities.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
@ -242,9 +242,9 @@ public class DropToUnlock extends JList<File> {
|
|||||||
try {
|
try {
|
||||||
String owner = Files.getOwner(f.toPath()).getName();
|
String owner = Files.getOwner(f.toPath()).getName();
|
||||||
String permissions = PosixFilePermissions.toString(Files.getPosixFilePermissions(f.toPath()));
|
String permissions = PosixFilePermissions.toString(Files.getPosixFilePermissions(f.toPath()));
|
||||||
UILogger.severe(String.format("Permission denied: %s (%s %s)", f, permissions, owner));
|
log.severe(String.format("Permission denied: %s (%s %s)", f, permissions, owner));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.severe(String.format("Permission denied: %s", f));
|
log.severe(String.format("Permission denied: %s", f));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.filebot.ui;
|
package net.filebot.ui;
|
||||||
|
|
||||||
import static javax.swing.ScrollPaneConstants.*;
|
import static javax.swing.ScrollPaneConstants.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
@ -207,7 +207,7 @@ public abstract class AbstractSearchPanel<S, E> extends JComponent {
|
|||||||
|
|
||||||
switch (results.size()) {
|
switch (results.size()) {
|
||||||
case 0:
|
case 0:
|
||||||
UILogger.log(Level.WARNING, String.format("'%s' has not been found.", requestProcessor.request.getSearchText()));
|
log.log(Level.WARNING, String.format("'%s' has not been found.", requestProcessor.request.getSearchText()));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
selectedSearchResult = results.iterator().next();
|
selectedSearchResult = results.iterator().next();
|
||||||
@ -231,7 +231,7 @@ public abstract class AbstractSearchPanel<S, E> extends JComponent {
|
|||||||
new FetchTask(requestProcessor).execute();
|
new FetchTask(requestProcessor).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
tab.close();
|
tab.close();
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
log.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -277,12 +277,12 @@ public abstract class AbstractSearchPanel<S, E> extends JComponent {
|
|||||||
|
|
||||||
// close tab if no elements were fetched
|
// close tab if no elements were fetched
|
||||||
if (get().size() <= 0) {
|
if (get().size() <= 0) {
|
||||||
UILogger.warning(statusMessage);
|
log.warning(statusMessage);
|
||||||
tab.close();
|
tab.close();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
tab.close();
|
tab.close();
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
log.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
||||||
} finally {
|
} finally {
|
||||||
tab.setLoading(false);
|
tab.setLoading(false);
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ import static java.awt.event.InputEvent.*;
|
|||||||
import static java.awt.event.KeyEvent.*;
|
import static java.awt.event.KeyEvent.*;
|
||||||
import static javax.swing.KeyStroke.*;
|
import static javax.swing.KeyStroke.*;
|
||||||
import static javax.swing.ScrollPaneConstants.*;
|
import static javax.swing.ScrollPaneConstants.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Cursor;
|
import java.awt.Cursor;
|
||||||
@ -114,7 +114,7 @@ public class MainFrame extends JFrame {
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
CacheManager.getInstance().clearAll();
|
CacheManager.getInstance().clearAll();
|
||||||
UILogger.info("Cache has been cleared");
|
log.info("Cache has been cleared");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,114 +1,80 @@
|
|||||||
|
|
||||||
package net.filebot.ui;
|
package net.filebot.ui;
|
||||||
|
|
||||||
|
|
||||||
import static net.filebot.Settings.*;
|
|
||||||
import static net.filebot.util.ui.notification.Direction.*;
|
import static net.filebot.util.ui.notification.Direction.*;
|
||||||
|
|
||||||
import java.awt.GraphicsEnvironment;
|
import java.awt.GraphicsEnvironment;
|
||||||
import java.util.logging.ConsoleHandler;
|
import java.util.logging.Formatter;
|
||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.LogRecord;
|
import java.util.logging.LogRecord;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
import net.filebot.ResourceManager;
|
import net.filebot.ResourceManager;
|
||||||
import net.filebot.util.ExceptionUtilities;
|
|
||||||
import net.filebot.util.ui.notification.MessageNotification;
|
import net.filebot.util.ui.notification.MessageNotification;
|
||||||
import net.filebot.util.ui.notification.NotificationManager;
|
import net.filebot.util.ui.notification.NotificationManager;
|
||||||
import net.filebot.util.ui.notification.QueueNotificationLayout;
|
import net.filebot.util.ui.notification.QueueNotificationLayout;
|
||||||
|
|
||||||
|
|
||||||
public class NotificationLogging extends Handler {
|
public class NotificationLogging extends Handler {
|
||||||
|
|
||||||
public static final Logger UILogger = createNotificationLogger("net.filebot.logger.ui");
|
private final String title;
|
||||||
|
private final int timeout;
|
||||||
|
private final NotificationManager manager;
|
||||||
|
|
||||||
|
public NotificationLogging(String title) {
|
||||||
private static Logger createNotificationLogger(String name) {
|
this(title, 2500, new NotificationManager(new QueueNotificationLayout(NORTH, SOUTH)));
|
||||||
Logger log = Logger.getLogger(name);
|
|
||||||
|
|
||||||
// don't use parent handlers
|
|
||||||
log.setUseParentHandlers(false);
|
|
||||||
|
|
||||||
// ui handler
|
|
||||||
log.addHandler(new NotificationLogging());
|
|
||||||
|
|
||||||
// console handler (for warnings and errors only)
|
|
||||||
ConsoleHandler console = new ConsoleHandler();
|
|
||||||
console.setLevel(Level.WARNING);
|
|
||||||
log.addHandler(console);
|
|
||||||
|
|
||||||
return log;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final NotificationManager notificationManager;
|
public NotificationLogging(String title, int timeout, NotificationManager manager) {
|
||||||
public final int timeout = 2500;
|
this.title = title;
|
||||||
|
this.timeout = timeout;
|
||||||
|
this.manager = manager;
|
||||||
|
|
||||||
|
setFormatter(new NotificationFormatter());
|
||||||
public NotificationLogging() {
|
setLevel(Level.INFO);
|
||||||
this(new NotificationManager(new QueueNotificationLayout(NORTH, SOUTH)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public NotificationLogging(NotificationManager notificationManager) {
|
|
||||||
this.notificationManager = notificationManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void publish(LogRecord record) {
|
public void publish(LogRecord record) {
|
||||||
// fail gracefully on an headless machine
|
// fail gracefully on an headless machine
|
||||||
if (GraphicsEnvironment.isHeadless())
|
if (GraphicsEnvironment.isHeadless())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
final Level level = record.getLevel();
|
String message = getFormatter().format(record);
|
||||||
final String message = getMessage(record);
|
Level level = record.getLevel();
|
||||||
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(() -> {
|
||||||
|
if (level == Level.INFO) {
|
||||||
@Override
|
show(message, ResourceManager.getIcon("message.info"), timeout * 1);
|
||||||
public void run() {
|
} else if (level == Level.WARNING) {
|
||||||
if (level == Level.INFO) {
|
show(message, ResourceManager.getIcon("message.warning"), timeout * 2);
|
||||||
show(message, ResourceManager.getIcon("message.info"), timeout * 1);
|
} else if (level == Level.SEVERE) {
|
||||||
} else if (level == Level.WARNING) {
|
show(message, ResourceManager.getIcon("message.error"), timeout * 3);
|
||||||
show(message, ResourceManager.getIcon("message.warning"), timeout * 2);
|
|
||||||
} else if (level == Level.SEVERE) {
|
|
||||||
show(message, ResourceManager.getIcon("message.error"), timeout * 3);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected String getMessage(LogRecord record) {
|
|
||||||
String message = record.getMessage();
|
|
||||||
|
|
||||||
if ((message == null || message.isEmpty()) && record.getThrown() != null) {
|
|
||||||
// if message is empty, display exception string
|
|
||||||
return ExceptionUtilities.getMessage(record.getThrown());
|
|
||||||
}
|
|
||||||
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected void show(String message, Icon icon, int timeout) {
|
protected void show(String message, Icon icon, int timeout) {
|
||||||
notificationManager.show(new MessageNotification(getApplicationName(), message, icon, timeout));
|
manager.show(new MessageNotification(title, message, icon, timeout));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws SecurityException {
|
public void close() throws SecurityException {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void flush() {
|
public void flush() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class NotificationFormatter extends Formatter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String format(LogRecord record) {
|
||||||
|
return record.getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.filebot.ui.analyze;
|
package net.filebot.ui.analyze;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.UserFiles.*;
|
import static net.filebot.UserFiles.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.ExceptionUtilities.*;
|
import static net.filebot.util.ExceptionUtilities.*;
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
@ -102,7 +102,7 @@ class ExtractTool extends Tool<TableModel> {
|
|||||||
if (findCause(e, InterruptedException.class) != null) {
|
if (findCause(e, InterruptedException.class) != null) {
|
||||||
throw findCause(e, InterruptedException.class);
|
throw findCause(e, InterruptedException.class);
|
||||||
}
|
}
|
||||||
UILogger.log(Level.WARNING, e.getMessage(), e);
|
log.log(Level.WARNING, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ArchiveEntryModel(entries);
|
return new ArchiveEntryModel(entries);
|
||||||
@ -297,7 +297,7 @@ class ExtractTool extends Tool<TableModel> {
|
|||||||
archive.close();
|
archive.close();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, "Failed to extract archive: " + file.getName(), e);
|
log.log(Level.WARNING, "Failed to extract archive: " + file.getName(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCancelled()) {
|
if (isCancelled()) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.filebot.ui.analyze;
|
package net.filebot.ui.analyze;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ class FileTreeTransferablePolicy extends BackgroundFileTransferablePolicy<TreeNo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void process(Exception e) {
|
protected void process(Exception e) {
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
log.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,8 +2,8 @@ package net.filebot.ui.list;
|
|||||||
|
|
||||||
import static java.awt.Font.*;
|
import static java.awt.Font.*;
|
||||||
import static java.lang.Math.*;
|
import static java.lang.Math.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.media.MediaDetection.*;
|
import static net.filebot.media.MediaDetection.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
@ -135,7 +135,7 @@ public class ListPanel extends JComponent {
|
|||||||
list.getModel().clear();
|
list.getModel().clear();
|
||||||
list.getModel().addAll(names);
|
list.getModel().addAll(names);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getMessage(e), e);
|
log.log(Level.WARNING, ExceptionUtilities.getMessage(e), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package net.filebot.ui.rename;
|
package net.filebot.ui.rename;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.MediaTypes.*;
|
import static net.filebot.MediaTypes.*;
|
||||||
import static net.filebot.UserFiles.*;
|
import static net.filebot.UserFiles.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@ -262,10 +262,10 @@ class BindingDialog extends JDialog {
|
|||||||
// check episode and media file
|
// check episode and media file
|
||||||
if (getInfoObject() == null) {
|
if (getInfoObject() == null) {
|
||||||
// illegal episode string
|
// illegal episode string
|
||||||
UILogger.warning(String.format("Failed to parse episode: '%s'", infoTextField.getText()));
|
log.warning(String.format("Failed to parse episode: '%s'", infoTextField.getText()));
|
||||||
} else if (getMediaFile() == null && !mediaFileTextField.getText().isEmpty()) {
|
} else if (getMediaFile() == null && !mediaFileTextField.getText().isEmpty()) {
|
||||||
// illegal file path
|
// illegal file path
|
||||||
UILogger.warning(String.format("Invalid media file: '%s'", mediaFileTextField.getText()));
|
log.warning(String.format("Invalid media file: '%s'", mediaFileTextField.getText()));
|
||||||
} else {
|
} else {
|
||||||
// everything seems to be in order
|
// everything seems to be in order
|
||||||
finish(true);
|
finish(true);
|
||||||
@ -304,7 +304,7 @@ class BindingDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (MediaInfoException e) {
|
} catch (MediaInfoException e) {
|
||||||
UILogger.log(Level.SEVERE, e.getMessage(), e);
|
log.log(Level.SEVERE, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// could not retrieve media info
|
// could not retrieve media info
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.filebot.ui.rename;
|
package net.filebot.ui.rename;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.MediaTypes.*;
|
import static net.filebot.MediaTypes.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
|
|
||||||
import java.awt.datatransfer.Transferable;
|
import java.awt.datatransfer.Transferable;
|
||||||
@ -112,7 +112,7 @@ class FilesListTransferablePolicy extends BackgroundFileTransferablePolicy<File>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void process(Exception e) {
|
protected void process(Exception e) {
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
log.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ package net.filebot.ui.rename;
|
|||||||
import static java.awt.Font.*;
|
import static java.awt.Font.*;
|
||||||
import static java.util.Collections.*;
|
import static java.util.Collections.*;
|
||||||
import static javax.swing.BorderFactory.*;
|
import static javax.swing.BorderFactory.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.ExceptionUtilities.*;
|
import static net.filebot.util.ExceptionUtilities.*;
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
@ -778,7 +778,7 @@ public class FormatDialog extends JDialog {
|
|||||||
|
|
||||||
finish(true);
|
finish(true);
|
||||||
} catch (ScriptException e) {
|
} catch (ScriptException e) {
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e));
|
log.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@ package net.filebot.ui.rename;
|
|||||||
|
|
||||||
import static java.awt.Font.*;
|
import static java.awt.Font.*;
|
||||||
import static javax.swing.BorderFactory.*;
|
import static javax.swing.BorderFactory.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
@ -409,7 +409,7 @@ public class PresetEditor extends JDialog {
|
|||||||
JComponent source = (JComponent) evt.getSource();
|
JComponent source = (JComponent) evt.getSource();
|
||||||
popup.show(source, -3, source.getHeight() + 4);
|
popup.show(source, -3, source.getHeight() + 4);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, "Invalid preset settings: " + e.getMessage(), e);
|
log.log(Level.WARNING, "Invalid preset settings: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -425,7 +425,7 @@ public class PresetEditor extends JDialog {
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, "Invalid preset settings: " + e.getMessage(), e);
|
log.log(Level.WARNING, "Invalid preset settings: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,8 +2,8 @@ package net.filebot.ui.rename;
|
|||||||
|
|
||||||
import static java.util.Collections.*;
|
import static java.util.Collections.*;
|
||||||
import static javax.swing.JOptionPane.*;
|
import static javax.swing.JOptionPane.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.ExceptionUtilities.*;
|
import static net.filebot.util.ExceptionUtilities.*;
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
@ -75,7 +75,7 @@ class RenameAction extends AbstractAction {
|
|||||||
Window window = getWindow(evt.getSource());
|
Window window = getWindow(evt.getSource());
|
||||||
try {
|
try {
|
||||||
if (model.files().isEmpty() || model.values().isEmpty()) {
|
if (model.files().isEmpty() || model.values().isEmpty()) {
|
||||||
UILogger.info("Nothing to rename. Please add some files and fetch naming data first.");
|
log.info("Nothing to rename. Please add some files and fetch naming data first.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ class RenameAction extends AbstractAction {
|
|||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
// ignore, handled in rename worker
|
// ignore, handled in rename worker
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
UILogger.log(Level.WARNING, e.getMessage(), e);
|
log.log(Level.WARNING, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.setCursor(Cursor.getDefaultCursor());
|
window.setCursor(Cursor.getDefaultCursor());
|
||||||
@ -341,7 +341,7 @@ class RenameAction extends AbstractAction {
|
|||||||
this.get(); // grab exception if any
|
this.get(); // grab exception if any
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (!isCancelled()) {
|
if (!isCancelled()) {
|
||||||
UILogger.log(Level.SEVERE, String.format("%s: %s", getRootCause(e).getClass().getSimpleName(), getRootCauseMessage(e)), e);
|
log.log(Level.SEVERE, String.format("%s: %s", getRootCause(e).getClass().getSimpleName(), getRootCauseMessage(e)), e);
|
||||||
} else {
|
} else {
|
||||||
Logger.getLogger(RenameAction.class.getName()).log(Level.SEVERE, e.getMessage(), e);
|
Logger.getLogger(RenameAction.class.getName()).log(Level.SEVERE, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
@ -361,7 +361,7 @@ class RenameAction extends AbstractAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (renameLog.size() > 0) {
|
if (renameLog.size() > 0) {
|
||||||
UILogger.info(String.format("%d files renamed.", renameLog.size()));
|
log.info(String.format("%d files renamed.", renameLog.size()));
|
||||||
HistorySpooler.getInstance().append(renameLog.entrySet());
|
HistorySpooler.getInstance().append(renameLog.entrySet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ import static java.awt.event.KeyEvent.*;
|
|||||||
import static javax.swing.JOptionPane.*;
|
import static javax.swing.JOptionPane.*;
|
||||||
import static javax.swing.KeyStroke.*;
|
import static javax.swing.KeyStroke.*;
|
||||||
import static javax.swing.SwingUtilities.*;
|
import static javax.swing.SwingUtilities.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.ExceptionUtilities.*;
|
import static net.filebot.util.ExceptionUtilities.*;
|
||||||
import static net.filebot.util.ui.LoadingOverlayPane.*;
|
import static net.filebot.util.ui.LoadingOverlayPane.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
@ -651,7 +651,7 @@ public class RenamePanel extends JComponent {
|
|||||||
// show and block
|
// show and block
|
||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, String.format("%s: %s", getRootCause(e).getClass().getSimpleName(), getRootCauseMessage(e)), e);
|
log.log(Level.WARNING, String.format("%s: %s", getRootCause(e).getClass().getSimpleName(), getRootCauseMessage(e)), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -754,7 +754,7 @@ public class RenamePanel extends JComponent {
|
|||||||
|
|
||||||
super.actionPerformed(evt);
|
super.actionPerformed(evt);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.info(e.getMessage());
|
log.info(e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
window.setCursor(Cursor.getDefaultCursor());
|
window.setCursor(Cursor.getDefaultCursor());
|
||||||
}
|
}
|
||||||
@ -892,7 +892,7 @@ public class RenamePanel extends JComponent {
|
|||||||
if (findCause(e, CancellationException.class) != null) {
|
if (findCause(e, CancellationException.class) != null) {
|
||||||
Logger.getLogger(RenamePanel.class.getName()).log(Level.WARNING, getRootCause(e).toString());
|
Logger.getLogger(RenamePanel.class.getName()).log(Level.WARNING, getRootCause(e).toString());
|
||||||
} else {
|
} else {
|
||||||
UILogger.log(Level.WARNING, String.format("%s: %s", getRootCause(e).getClass().getSimpleName(), getRootCauseMessage(e)), e);
|
log.log(Level.WARNING, String.format("%s: %s", getRootCause(e).getClass().getSimpleName(), getRootCauseMessage(e)), e);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
// auto-match finished
|
// auto-match finished
|
||||||
|
@ -2,10 +2,10 @@ package net.filebot.ui.sfv;
|
|||||||
|
|
||||||
import static java.util.Arrays.*;
|
import static java.util.Arrays.*;
|
||||||
import static java.util.Collections.*;
|
import static java.util.Collections.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.MediaTypes.*;
|
import static net.filebot.MediaTypes.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.hash.VerificationUtilities.*;
|
import static net.filebot.hash.VerificationUtilities.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ class ChecksumTableTransferablePolicy extends BackgroundFileTransferablePolicy<C
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void process(Exception e) {
|
protected void process(Exception e) {
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
log.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final ThreadLocal<ExecutorService> executor = new ThreadLocal<ExecutorService>();
|
private final ThreadLocal<ExecutorService> executor = new ThreadLocal<ExecutorService>();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.filebot.ui.subtitle;
|
package net.filebot.ui.subtitle;
|
||||||
|
|
||||||
import static java.nio.charset.StandardCharsets.*;
|
import static java.nio.charset.StandardCharsets.*;
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.MediaTypes.*;
|
import static net.filebot.MediaTypes.*;
|
||||||
import static net.filebot.UserFiles.*;
|
import static net.filebot.UserFiles.*;
|
||||||
import static net.filebot.subtitle.SubtitleUtilities.*;
|
import static net.filebot.subtitle.SubtitleUtilities.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ class SubtitleDownloadComponent extends JComponent {
|
|||||||
} catch (CancellationException e) {
|
} catch (CancellationException e) {
|
||||||
// ignore cancellation
|
// ignore cancellation
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
log.log(Level.WARNING, ExceptionUtilities.getRootCauseMessage(e), e);
|
||||||
|
|
||||||
// reset download
|
// reset download
|
||||||
subtitle.reset();
|
subtitle.reset();
|
||||||
@ -261,7 +261,7 @@ class SubtitleDownloadComponent extends JComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, e.getMessage(), e);
|
log.log(Level.WARNING, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ class SubtitleDownloadComponent extends JComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, e.getMessage(), e);
|
log.log(Level.WARNING, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ class SubtitleDownloadComponent extends JComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, e.getMessage(), e);
|
log.log(Level.WARNING, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package net.filebot.ui.subtitle;
|
package net.filebot.ui.subtitle;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.MediaTypes.*;
|
import static net.filebot.MediaTypes.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.UserFiles.*;
|
import static net.filebot.UserFiles.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.ui.transfer.FileTransferable.*;
|
import static net.filebot.ui.transfer.FileTransferable.*;
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
@ -128,7 +128,7 @@ abstract class SubtitleDropTarget extends JButton {
|
|||||||
SwingUtilities.invokeLater(() -> handleDrop(files));
|
SwingUtilities.invokeLater(() -> handleDrop(files));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, e.getMessage(), e);
|
log.log(Level.WARNING, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
dtde.dropComplete(accept);
|
dtde.dropComplete(accept);
|
||||||
@ -167,12 +167,12 @@ abstract class SubtitleDropTarget extends JButton {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean handleDrop(List<File> input) {
|
protected boolean handleDrop(List<File> input) {
|
||||||
if (getQueryLanguage() == null) {
|
if (getQueryLanguage() == null) {
|
||||||
UILogger.info("Please select your preferred subtitle language.");
|
log.info("Please select your preferred subtitle language.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getSubtitleService().isAnonymous() && !Settings.isAppStore()) {
|
if (getSubtitleService().isAnonymous() && !Settings.isAppStore()) {
|
||||||
UILogger.info(String.format("%s: Please enter your login details.", getSubtitleService().getName()));
|
log.info(String.format("%s: Please enter your login details.", getSubtitleService().getName()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ abstract class SubtitleDropTarget extends JButton {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean handleDrop(List<File> input) {
|
protected boolean handleDrop(List<File> input) {
|
||||||
if (getSubtitleService().isAnonymous()) {
|
if (getSubtitleService().isAnonymous()) {
|
||||||
UILogger.info(String.format("%s: You must be logged in to upload subtitles.", getSubtitleService().getName()));
|
log.info(String.format("%s: You must be logged in to upload subtitles.", getSubtitleService().getName()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package net.filebot.ui.subtitle;
|
package net.filebot.ui.subtitle;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.Settings.*;
|
import static net.filebot.Settings.*;
|
||||||
import static net.filebot.ui.LanguageComboBoxModel.*;
|
import static net.filebot.ui.LanguageComboBoxModel.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||||||
SubtitleProvider provider = searchTextField.getSelectButton().getSelectedValue();
|
SubtitleProvider provider = searchTextField.getSelectButton().getSelectedValue();
|
||||||
|
|
||||||
if (provider instanceof OpenSubtitlesClient && ((OpenSubtitlesClient) provider).isAnonymous() && !Settings.isAppStore()) {
|
if (provider instanceof OpenSubtitlesClient && ((OpenSubtitlesClient) provider).isAnonymous() && !Settings.isAppStore()) {
|
||||||
UILogger.info(String.format("%s: Please enter your login details first.", ((OpenSubtitlesClient) provider).getName()));
|
log.info(String.format("%s: Please enter your login details first.", ((OpenSubtitlesClient) provider).getName()));
|
||||||
|
|
||||||
// automatically open login dialog
|
// automatically open login dialog
|
||||||
SwingUtilities.invokeLater(() -> setUserAction.actionPerformed(new ActionEvent(searchTextField, 0, "login")));
|
SwingUtilities.invokeLater(() -> setUserAction.actionPerformed(new ActionEvent(searchTextField, 0, "login")));
|
||||||
@ -372,7 +372,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||||||
try {
|
try {
|
||||||
// check download quota for the current user
|
// check download quota for the current user
|
||||||
Map<?, ?> limits = (Map<?, ?>) osdb.getServerInfo().get("download_limits");
|
Map<?, ?> limits = (Map<?, ?>) osdb.getServerInfo().get("download_limits");
|
||||||
UILogger.log(Level.INFO, String.format("Your daily download quota is at %s of %s.", limits.get("client_24h_download_count"), limits.get("client_24h_download_limit")));
|
log.log(Level.INFO, String.format("Your daily download quota is at %s of %s.", limits.get("client_24h_download_count"), limits.get("client_24h_download_limit")));
|
||||||
|
|
||||||
// logout from test session
|
// logout from test session
|
||||||
osdb.logout();
|
osdb.logout();
|
||||||
@ -384,7 +384,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||||||
WebServices.setLogin(WebServices.LOGIN_OPENSUBTITLES, null, null); // delete login details
|
WebServices.setLogin(WebServices.LOGIN_OPENSUBTITLES, null, null); // delete login details
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, "OpenSubtitles: " + e.getMessage());
|
log.log(Level.WARNING, "OpenSubtitles: " + e.getMessage());
|
||||||
approved = false;
|
approved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.filebot.ui.subtitle.upload;
|
package net.filebot.ui.subtitle.upload;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.media.MediaDetection.*;
|
import static net.filebot.media.MediaDetection.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
import static net.filebot.util.ui.SwingUI.*;
|
import static net.filebot.util.ui.SwingUI.*;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
@ -65,7 +65,7 @@ class MovieEditor implements TableCellEditor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (options.isEmpty()) {
|
if (options.isEmpty()) {
|
||||||
UILogger.warning(String.format("%s: No results", database.getName()));
|
log.warning(String.format("%s: No results", database.getName()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.filebot.ui.transfer;
|
package net.filebot.ui.transfer;
|
||||||
|
|
||||||
|
import static net.filebot.Logging.*;
|
||||||
import static net.filebot.UserFiles.*;
|
import static net.filebot.UserFiles.*;
|
||||||
import static net.filebot.ui.NotificationLogging.*;
|
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -58,7 +58,7 @@ public class LoadAction extends AbstractAction {
|
|||||||
transferablePolicy.handleTransferable(transferable, getTransferAction(evt));
|
transferablePolicy.handleTransferable(transferable, getTransferAction(evt));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UILogger.log(Level.WARNING, e.toString(), e);
|
log.log(Level.WARNING, e.toString(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user