示例#1
0
  public static void main(String[] args) {

    LogManager.initLogManager();

    // Paramètres par défaut du programme
    execMode mode = execMode.GUI;
    String configFile = "";

    if (args.length > 0) {
      for (int i = 0; i < args.length; i++) {
        if (args[i].equals("-console")) mode = execMode.CONSOLE;
        if (args[i].equals("-configFile")) configFile = args[++i];
      }
    }

    if (mode == execMode.CONSOLE) {
      app = new Console();
      if (!configFile.equals("")) configFile = "urlbooster.ini";
    } else {
      app = new Gui();
      if (!configFile.equals("")) configFile = "urlbooster.xml";
    }

    app.getConfig().setPropertiesFile(configFile);
    app.init();
    app.setPriority(Thread.MIN_PRIORITY);
    app.start();

    while (!app.isTerminate()) {
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
        LogManager.traceException(e);
      }
    }
  }
示例#2
0
 public static void logInfo(String msg) {
   app.logInfo(msg);
 }