From 581d42c09b2673025e719a25477565362ebf4482 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sun, 26 Nov 2017 20:39:39 +0100 Subject: [PATCH] Fix the traces handler system --- ...es.jar => nikiroo-utils-2.2.3-sources.jar} | Bin 260060 -> 260661 bytes src/be/nikiroo/fanfix/Instance.java | 111 ++++++------------ .../fanfix/reader/TuiReaderApplication.java | 21 +--- .../fanfix/supported/FimfictionApi.java | 1 + src/be/nikiroo/fanfix/test/Test.java | 2 + 5 files changed, 40 insertions(+), 95 deletions(-) rename libs/{nikiroo-utils-2.2.2-sources.jar => nikiroo-utils-2.2.3-sources.jar} (95%) diff --git a/libs/nikiroo-utils-2.2.2-sources.jar b/libs/nikiroo-utils-2.2.3-sources.jar similarity index 95% rename from libs/nikiroo-utils-2.2.2-sources.jar rename to libs/nikiroo-utils-2.2.3-sources.jar index 318670fd7d1ef25318a10d5eeddfb1fcc7914f23..55e697f78d6e10fd86287141f04ed0be09b162da 100644 GIT binary patch delta 7580 zcmY*;bzD_T_xIs!K)SmGq+1$ki|#%kjYxMRhejGiIJ79;-Q6MG(g*48MqcjqzR$hC z{m*>Xch#(!*)y}&EF5B2pJ8Jt%K?Z4AQTi75X1La3}G?b-a|2guw9m?8 zAYxE4OYy^PI^atn9eZ3e|8w7yA>j>Z^Caz1?-K#rd<9@Q`QEl)zC5N zk`ro*$G-orMWw#);$va0riD+FyO9lCz`1l0+K|l3?BTk{Z_~a$95RwB1WSU{h|Fzj-{=r*hqM|j@fuR4w|EN$!t85tktwEtW&i}la|#f+-DAxM3=}|23!fn9I5H~DgUrkK5qL3d6maUoRVlA zoR7=p`BWKB=0k;r#!i*A?wf&DAAI|Bx3dy?chu_U{r7X>p^C6d!|m{30qX0L^3M^^ z)q$`nkWGro-Vu}2JoxNMc)DtB|GlRc*AUex?Irt7IXTuP%A9k}236m<{Y~C41z}zR z6un?5NHG^t#7*VH4@a6ViEF{2Eu*8WF3zcP?KN#iMfYZ$AudIptqV1AL(ReCKJ8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U~Az|!Ookf z%rhe5d>^*o323#BaOYtk96nj(&87e;=J>J0ozI4sAufGa%g4r;) za`FFjLx8gnlE6aT87TjECl52&2blx?8em9AAX3=WK8Oui`@f(A5e&wDfMDbsALWDz zAR5fD5r_|q`b+b-{G};jQwJb^AX>+x4fP?SQ}NzMMY$J<1%qFKp1|S`LDWF1FON2? zUw}A&Lp*`4A!wx4v?GuTFl^#cM0A1&8$ANy!Xl19To?2>?(5{(Zhu!-7vh1c(C+AtX&$ z&})&WAF{*|d7fZ?7avPNR^2+Ynwq_l}a zzRJ?@|5s!Hfa2d_11PN@P0Pvi23C_9uz|Xxu3XzsxIyi(1M*G$NcV&@c5LM(P?-XoBK@ znE!NXUW%AX$u+`XvEm=?;2JUAp87{d1ded+>v#kaa1bZ({C@#^HwYiL07rOh_dd!o z{fHWH-XIwM!AHjN22l{rFOLA>fDRkD0SN+ozCJQow;*zCdw@Nlf(`(noB<(n`9E7D BBBTHS diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index df990d7..c48b119 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -12,7 +12,9 @@ import be.nikiroo.fanfix.bundles.UiConfig; import be.nikiroo.fanfix.bundles.UiConfigBundle; import be.nikiroo.fanfix.library.BasicLibrary; import be.nikiroo.fanfix.library.LocalLibrary; +import be.nikiroo.utils.Cache; import be.nikiroo.utils.IOUtils; +import be.nikiroo.utils.TraceHandler; import be.nikiroo.utils.resources.Bundles; /** @@ -21,56 +23,16 @@ import be.nikiroo.utils.resources.Bundles; * @author niki */ public class Instance { - /** - * A handler when a recoverable exception was caught by the program. - * - * @author niki - */ - public interface SyserrHandler { - /** - * An exception happened, log it. - * - * @param e - * the exception - * @param showDetails - * show more details (usually equivalent to the value of - * DEBUG) - */ - public void notify(Exception e, boolean showDetails); - } - - /** - * A handler when a trace message is sent. - * - * @author niki - */ - public interface TraceHandler { - /** - * A trace happened, show it. - *

- * Will only be called if TRACE is true. - * - * @param message - * the trace message - */ - public void trace(String message); - } - private static ConfigBundle config; private static UiConfigBundle uiconfig; private static StringIdBundle trans; private static DataLoader cache; private static LocalLibrary lib; - private static boolean debug; - private static boolean trace; private static File coverDir; private static File readerTmp; private static File remoteDir; private static String configDir; - - private static SyserrHandler syserrHandler; - - private static TraceHandler traceHandler; + private static TraceHandler tracer; static { // Most of the rest is dependent upon this: @@ -127,8 +89,10 @@ public class Instance { + getFile(Config.LIBRARY_DIR), e)); } - debug = Instance.getConfig().getBoolean(Config.DEBUG_ERR, false); - trace = Instance.getConfig().getBoolean(Config.DEBUG_TRACE, false); + boolean debug = Instance.getConfig() + .getBoolean(Config.DEBUG_ERR, false); + boolean trace = Instance.getConfig().getBoolean(Config.DEBUG_TRACE, + false); coverDir = getFile(Config.DEFAULT_COVERS_DIR); File tmp = getFile(Config.CACHE_DIR); readerTmp = getFile(UiConfig.CACHE_DIR_LOCAL_READER); @@ -142,6 +106,10 @@ public class Instance { debug = true; } + tracer = new TraceHandler(); + tracer.setShowErrorDetails(debug); + tracer.setShowTraces(trace); + // Could have used: System.getProperty("java.io.tmpdir") if (tmp == null) { tmp = new File(configDir, "tmp"); @@ -171,6 +139,25 @@ public class Instance { } } + /** + * The traces handler for this {@link Cache}. + * + * @return the traces handler or NULL + */ + public static TraceHandler getTraceHandler() { + return tracer; + } + + /** + * The traces handler for this {@link Cache}. + * + * @param tracer + * the new traces handler or NULL + */ + public static void setTraceHandler(TraceHandler tracer) { + Instance.tracer = tracer; + } + /** * Get the (unique) configuration service for the program. * @@ -293,26 +280,6 @@ public class Instance { } } - /** - * Replace the global syserr handler. - * - * @param syserrHandler - * the new syserr handler - */ - public static void setSyserrHandler(SyserrHandler syserrHandler) { - Instance.syserrHandler = syserrHandler; - } - - /** - * Replace the global trace handler. - * - * @param traceHandler - * the new trace handler - */ - public static void setTraceHandler(TraceHandler traceHandler) { - Instance.traceHandler = traceHandler; - } - /** * Report an error to the user * @@ -320,14 +287,8 @@ public class Instance { * the {@link Exception} to report */ public static void syserr(Exception e) { - if (syserrHandler != null) { - syserrHandler.notify(e, debug); - } else { - if (debug) { - e.printStackTrace(); - } else { - System.err.println(e.getMessage()); - } + if (tracer != null) { + tracer.error(e); } } @@ -338,12 +299,8 @@ public class Instance { * the message */ public static void trace(String message) { - if (trace) { - if (traceHandler != null) { - traceHandler.trace(message); - } else { - System.out.println(message); - } + if (tracer != null) { + tracer.trace(message); } } diff --git a/src/be/nikiroo/fanfix/reader/TuiReaderApplication.java b/src/be/nikiroo/fanfix/reader/TuiReaderApplication.java index fd58509..c1bba5a 100644 --- a/src/be/nikiroo/fanfix/reader/TuiReaderApplication.java +++ b/src/be/nikiroo/fanfix/reader/TuiReaderApplication.java @@ -14,8 +14,6 @@ import jexer.TWindow; import jexer.event.TMenuEvent; import jexer.menu.TMenu; import be.nikiroo.fanfix.Instance; -import be.nikiroo.fanfix.Instance.SyserrHandler; -import be.nikiroo.fanfix.Instance.TraceHandler; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.library.BasicLibrary; @@ -140,21 +138,8 @@ class TuiReaderApplication extends TApplication implements Reader { private void init(Reader reader) { this.reader = reader; - // Do not allow traces/debug to pollute the screen: - Instance.setSyserrHandler(new SyserrHandler() { - @Override - public void notify(Exception e, boolean showDetails) { - // TODO - } - }); - - Instance.setTraceHandler(new TraceHandler() { - @Override - public void trace(String message) { - // TODO - } - }); - // + // TODO: traces/errors? + Instance.setTraceHandler(null); // Add the menus TODO: i18n TMenu fileMenu = addMenu("&File"); @@ -188,7 +173,7 @@ class TuiReaderApplication extends TApplication implements Reader { case MENU_EXIT: if (messageBox("Confirmation", "(TODO: i18n) Exit application?", TMessageBox.Type.YESNO).getResult() == TMessageBox.Result.YES) { - //exit(false); + // exit(false); } return true; diff --git a/src/be/nikiroo/fanfix/supported/FimfictionApi.java b/src/be/nikiroo/fanfix/supported/FimfictionApi.java index 3319bbe..ee436f1 100644 --- a/src/be/nikiroo/fanfix/supported/FimfictionApi.java +++ b/src/be/nikiroo/fanfix/supported/FimfictionApi.java @@ -254,6 +254,7 @@ class FimfictionApi extends BasicSupport { null, null); String jsonToken = IOUtils.readSmallStream(in); + in.close(); // Extract token type and token from: { // token_type = "Bearer", diff --git a/src/be/nikiroo/fanfix/test/Test.java b/src/be/nikiroo/fanfix/test/Test.java index e0832b1..0dc544b 100644 --- a/src/be/nikiroo/fanfix/test/Test.java +++ b/src/be/nikiroo/fanfix/test/Test.java @@ -5,6 +5,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; +import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.bundles.ConfigBundle; import be.nikiroo.utils.IOUtils; import be.nikiroo.utils.resources.Bundles; @@ -18,6 +19,7 @@ import be.nikiroo.utils.test.TestLauncher; public class Test extends TestLauncher { public Test(String[] args) { super("Fanfix", args); + Instance.setTraceHandler(null); addSeries(new BasicSupportTest(args)); addSeries(new LibraryTest(args)); } -- 2.27.0