OSDN Git Service

loggingライブラリをslf4jに変更
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / MainFrame.java
index 9112f5c..310e131 100644 (file)
@@ -30,8 +30,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.SortedSet;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import javax.swing.BorderFactory;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.DropMode;
@@ -94,7 +94,7 @@ import yukihane.inqubus.model.TargetsTableModel;
 public class MainFrame extends JFrame {
 
     private static final long serialVersionUID = 1L;
-    private static final Logger logger = Logger.getLogger(MainFrame.class.getName());
+    private static final Logger logger = LoggerFactory.getLogger(MainFrame.class);
     private final TargetsTableModel targetModel = new TargetsTableModel();
     private final TaskManage taskManager;
     private final Thread videoFileWatcherThread;
@@ -559,7 +559,7 @@ public class MainFrame extends JFrame {
             final int row = tblDisplay.getSelectedRow();
             final Target t = targetModel.getTarget(row);
             final boolean res = taskManager.cancel(t.getRowId());
-            logger.log(Level.FINE, "停止: {0} {1}", new Object[]{t.getVideoId(), res});
+            logger.debug("停止: {0} {1}", new Object[]{t.getVideoId(), res});
             if (res) {
                 targetModel.setStatus(t.getRowId(), null, TaskStatus.CANCELLED, -1.0, "キャンセル");
             }
@@ -574,14 +574,14 @@ public class MainFrame extends JFrame {
                 final DownloadProfile downProf = new InqubusDownloadProfile();
                 final String id = Util.getVideoId(cmbId.getText());
                 final InqubusConvertProfile convProf = new InqubusConvertProfile();
-                logger.log(Level.INFO, downProf.toString());
-                logger.log(Level.INFO, convProf.toString());
+                logger.debug(downProf.toString());
+                logger.debug(convProf.toString());
                 final RequestProcess rp = new RequestProcess(downProf, id, convProf);
                 taskManager.add(rp);
                 targetModel.addTarget(new Target(rp));
                 initInputPanel();
             } catch (Throwable th) {
-                logger.log(Level.SEVERE, null, th);
+                logger.error(null, th);
                 JOptionPane.showMessageDialog(MainFrame.this, th.getMessage(), "中断しました", JOptionPane.ERROR_MESSAGE);
             }
         }
@@ -778,7 +778,7 @@ public class MainFrame extends JFrame {
             try {
                 p.save();
             } catch (ConfigurationException ex) {
-                logger.log(Level.SEVERE, "コンフィグ保存失敗", ex);
+                logger.error("コンフィグ保存失敗", ex);
             }
         }
     }