Revision | 228289dc57c58b1b02868991bd4f08e36ed94e17 (tree) |
---|---|
Time | 2013-04-01 21:16:35 |
Author | nekora <nekora@user...> |
Commiter | nekora |
エラー時処理変更。ログにスタックトレースを出す、タスクが一つ失敗しても次のタスクの結果を引き出す。
@@ -1 +1,2 @@ | ||
1 | 1 | /nekora |
2 | +/makejar.bat |
@@ -0,0 +1 @@ | ||
1 | +jar cvf cwnprint.jar nekora | |
\ No newline at end of file |
@@ -9,6 +9,7 @@ import java.util.concurrent.ExecutionException; | ||
9 | 9 | import java.util.concurrent.ExecutorService; |
10 | 10 | import java.util.concurrent.Executors; |
11 | 11 | import java.util.concurrent.Future; |
12 | +import java.util.logging.Level; | |
12 | 13 | import java.util.logging.Logger; |
13 | 14 | |
14 | 15 | import nekora.cwn.align.PageAlign; |
@@ -113,13 +114,13 @@ class MDPSTask extends Task<String> { | ||
113 | 114 | f.get(); |
114 | 115 | num ++; |
115 | 116 | }catch(InterruptedException e){ |
116 | - logger.warning(e.getLocalizedMessage()); | |
117 | + logger.log(Level.WARNING, "コマンド終了待ち中にInterrupt", e.getLocalizedMessage()); | |
117 | 118 | e.printStackTrace(); |
118 | - throw new RuntimeException(e); | |
119 | + //throw new RuntimeException(e); | |
119 | 120 | }catch(ExecutionException e){ |
120 | - logger.warning(e.getLocalizedMessage()); | |
121 | + logger.log(Level.WARNING, "コマンド終了待ち中に実行時エラー(しかし処理は続行)", e.getLocalizedMessage()); | |
121 | 122 | e.printStackTrace(); |
122 | - throw new RuntimeException(e); | |
123 | + //throw new RuntimeException(e); | |
123 | 124 | } |
124 | 125 | } |
125 | 126 |
@@ -4,6 +4,7 @@ import java.awt.Point; | ||
4 | 4 | import java.awt.Rectangle; |
5 | 5 | import java.io.File; |
6 | 6 | import java.io.IOException; |
7 | +import java.util.logging.Level; | |
7 | 8 | import java.util.logging.Logger; |
8 | 9 | |
9 | 10 | import nekora.cwn.paper.InputPaper; |
@@ -48,7 +49,7 @@ public class MixOut1to1 extends MixOut { | ||
48 | 49 | logger.info("Left="+outputFileNameL+" R="+outputFileNameR); |
49 | 50 | }catch(IOException e){ |
50 | 51 | String msg = "出力ファイル設定失敗 "+ret+" err="+e.getLocalizedMessage(); |
51 | - logger.warning(msg); | |
52 | + logger.log(Level.WARNING, msg, e); | |
52 | 53 | return msg; |
53 | 54 | } |
54 | 55 |
@@ -131,7 +132,7 @@ public class MixOut1to1 extends MixOut { | ||
131 | 132 | |
132 | 133 | } catch (MagickException e) { |
133 | 134 | String msg = e.getLocalizedMessage(); |
134 | - logger.warning(msg); | |
135 | + logger.log(Level.WARNING, msg, e); | |
135 | 136 | e.printStackTrace(); |
136 | 137 | }finally{ |
137 | 138 | if(cropImage != null){ |
@@ -2,6 +2,7 @@ package nekora.cwn.mix; | ||
2 | 2 | |
3 | 3 | import java.awt.Point; |
4 | 4 | import java.awt.Rectangle; |
5 | +import java.util.logging.Level; | |
5 | 6 | import java.util.logging.Logger; |
6 | 7 | |
7 | 8 | import nekora.cwn.paper.InputPaper; |
@@ -74,7 +75,7 @@ public class MixOut2in1 extends MixOut { | ||
74 | 75 | } |
75 | 76 | } catch (MagickException e) { |
76 | 77 | String msg = e.getLocalizedMessage(); |
77 | - logger.warning(msg); | |
78 | + logger.log(Level.WARNING, "処理失敗 ERROR="+ msg ,e); | |
78 | 79 | e.printStackTrace(); |
79 | 80 | }finally{ |
80 | 81 | if(cropImageALL != null){ |
@@ -105,7 +106,7 @@ public class MixOut2in1 extends MixOut { | ||
105 | 106 | } |
106 | 107 | |
107 | 108 | |
108 | - logger.info("Done="+ret); | |
109 | + logger.info("終了="+ret); | |
109 | 110 | return ret; |
110 | 111 | } |
111 | 112 |