• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision228289dc57c58b1b02868991bd4f08e36ed94e17 (tree)
Time2013-04-01 21:16:35
Authornekora <nekora@user...>
Commiternekora

Log Message

エラー時処理変更。ログにスタックトレースを出す、タスクが一つ失敗しても次のタスクの結果を引き出す。

Change Summary

Incremental Difference

--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1 +1,2 @@
11 /nekora
2+/makejar.bat
--- /dev/null
+++ b/src/makejar.bat
@@ -0,0 +1 @@
1+jar cvf cwnprint.jar nekora
\ No newline at end of file
--- a/src/nekora/cwn/MDPSTask.java
+++ b/src/nekora/cwn/MDPSTask.java
@@ -9,6 +9,7 @@ import java.util.concurrent.ExecutionException;
99 import java.util.concurrent.ExecutorService;
1010 import java.util.concurrent.Executors;
1111 import java.util.concurrent.Future;
12+import java.util.logging.Level;
1213 import java.util.logging.Logger;
1314
1415 import nekora.cwn.align.PageAlign;
@@ -113,13 +114,13 @@ class MDPSTask extends Task<String> {
113114 f.get();
114115 num ++;
115116 }catch(InterruptedException e){
116- logger.warning(e.getLocalizedMessage());
117+ logger.log(Level.WARNING, "コマンド終了待ち中にInterrupt", e.getLocalizedMessage());
117118 e.printStackTrace();
118- throw new RuntimeException(e);
119+ //throw new RuntimeException(e);
119120 }catch(ExecutionException e){
120- logger.warning(e.getLocalizedMessage());
121+ logger.log(Level.WARNING, "コマンド終了待ち中に実行時エラー(しかし処理は続行)", e.getLocalizedMessage());
121122 e.printStackTrace();
122- throw new RuntimeException(e);
123+ //throw new RuntimeException(e);
123124 }
124125 }
125126
--- a/src/nekora/cwn/mix/MixOut1to1.java
+++ b/src/nekora/cwn/mix/MixOut1to1.java
@@ -4,6 +4,7 @@ import java.awt.Point;
44 import java.awt.Rectangle;
55 import java.io.File;
66 import java.io.IOException;
7+import java.util.logging.Level;
78 import java.util.logging.Logger;
89
910 import nekora.cwn.paper.InputPaper;
@@ -48,7 +49,7 @@ public class MixOut1to1 extends MixOut {
4849 logger.info("Left="+outputFileNameL+" R="+outputFileNameR);
4950 }catch(IOException e){
5051 String msg = "出力ファイル設定失敗 "+ret+" err="+e.getLocalizedMessage();
51- logger.warning(msg);
52+ logger.log(Level.WARNING, msg, e);
5253 return msg;
5354 }
5455
@@ -131,7 +132,7 @@ public class MixOut1to1 extends MixOut {
131132
132133 } catch (MagickException e) {
133134 String msg = e.getLocalizedMessage();
134- logger.warning(msg);
135+ logger.log(Level.WARNING, msg, e);
135136 e.printStackTrace();
136137 }finally{
137138 if(cropImage != null){
--- a/src/nekora/cwn/mix/MixOut2in1.java
+++ b/src/nekora/cwn/mix/MixOut2in1.java
@@ -2,6 +2,7 @@ package nekora.cwn.mix;
22
33 import java.awt.Point;
44 import java.awt.Rectangle;
5+import java.util.logging.Level;
56 import java.util.logging.Logger;
67
78 import nekora.cwn.paper.InputPaper;
@@ -74,7 +75,7 @@ public class MixOut2in1 extends MixOut {
7475 }
7576 } catch (MagickException e) {
7677 String msg = e.getLocalizedMessage();
77- logger.warning(msg);
78+ logger.log(Level.WARNING, "処理失敗 ERROR="+ msg ,e);
7879 e.printStackTrace();
7980 }finally{
8081 if(cropImageALL != null){
@@ -105,7 +106,7 @@ public class MixOut2in1 extends MixOut {
105106 }
106107
107108
108- logger.info("Done="+ret);
109+ logger.info("終了="+ret);
109110 return ret;
110111 }
111112