X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FMain.java;h=0f5e5aedcf368508585a6be446dac22810afef3c;hb=5af7e82a86fa1e64a1c8d34f303c3a393c6ecd87;hp=1138dc2c450c9b3a0ac05768ffa9fe6872a02a8a;hpb=874f7bd2c0c0435f613b8f9f5b3a16ebf2b4839b;p=jSite.git diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index 1138dc2..0f5e5ae 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -30,6 +30,10 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.Map.Entry; +import java.util.logging.ConsoleHandler; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.AbstractAction; import javax.swing.Action; @@ -69,9 +73,6 @@ import de.todesbaum.util.swing.WizardListener; */ public class Main implements ActionListener, ListSelectionListener, WizardListener, NodeManagerListener, UpdateListener { - /** Whether the debug mode is activated. */ - private static boolean debug = false; - /** The version. */ private static final Version VERSION = new Version(0, 7); @@ -304,7 +305,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen pages.put(PageType.PAGE_PROJECT_FILES, projectFilesPage); ProjectInsertPage projectInsertPage = new ProjectInsertPage(wizard); - projectInsertPage.setDebug(debug); projectInsertPage.setName("page.project.insert"); projectInsertPage.setFreenetInterface(freenetInterface); pages.put(PageType.PAGE_INSERT_PROJECT, projectInsertPage); @@ -611,6 +611,10 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen * The command-line arguments */ public static void main(String[] args) { + /* initialize logger. */ + Logger logger = Logger.getLogger("de.todesbaum"); + Handler handler = new ConsoleHandler(); + logger.addHandler(handler); String configFilename = null; boolean nextIsConfigFilename = false; for (String argument : args) { @@ -622,7 +626,8 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen printHelp(); return; } else if ("--debug".equals(argument)) { - debug = true; + logger.setLevel(Level.ALL); + handler.setLevel(Level.ALL); } else if ("--config-file".equals(argument)) { nextIsConfigFilename = true; }