X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FTraceHandler.java;h=0a09712d5218013992493838c75ad9aa0ad92527;hb=9e7330d793887fe9ee378ca1413141d7761e76ca;hp=5fa08438c3abe2e1a01e916d37f8d83b9c84ae8f;hpb=530d4062471346d6ececf76d74a0358c91323998;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/TraceHandler.java b/src/be/nikiroo/utils/TraceHandler.java deleted file mode 100644 index 5fa0843..0000000 --- a/src/be/nikiroo/utils/TraceHandler.java +++ /dev/null @@ -1,88 +0,0 @@ -package be.nikiroo.utils; - -/** - * A handler when a trace message is sent or when a recoverable exception was - * caught by the program. - * - * @author niki - */ -public class TraceHandler { - private boolean showErrorDetails; - private boolean showTraces; - - /** - * Show more details (usually equivalent to the value of DEBUG). - * - * @return TRUE or FALSE - */ - public boolean isShowErrorDetails() { - return showErrorDetails; - } - - /** - * Show more details (usually equivalent to the value of DEBUG). - * - * @param showErrorDetails - * TRUE or FALSE - */ - public void setShowErrorDetails(boolean showErrorDetails) { - this.showErrorDetails = showErrorDetails; - } - - /** - * Show DEBUG traces. - * - * @return TRUE or FALSE - */ - public boolean isShowTraces() { - return showTraces; - } - - /** - * Show DEBUG traces. - * - * @param showTraces - * TRUE or FALSE - */ - public void setShowTraces(boolean showTraces) { - this.showTraces = showTraces; - } - - /** - * An exception happened, log it. - * - * @param e - * the exception - */ - public void error(Exception e) { - if (isShowErrorDetails()) { - e.printStackTrace(); - } else { - error(e.getMessage()); - } - } - - /** - * An error happened, log it. - * - * @param message - * the error message - */ - public void error(String message) { - System.err.println(message); - } - - /** - * A trace happened, show it. - *

- * Will only be effective if {@link TraceHandler#isShowTraces()} is true. - * - * @param message - * the trace message - */ - public void trace(String message) { - if (isShowTraces()) { - System.out.println(message); - } - } -}