public static void main(String[] args) {
		parseCommandLine(args);
		initLogger(); // --> logger
		try {
			
			logger.info( String.format(
					"Starting to download%n from <%s>%n into <%s> %s%n",
					baseURL, saveTo, forceTagging?"with retagging existing files.":""));
			cache = new XMLCache(xmlFileName);
			if (isInConsoleMode) {
				SoloThreadConsoleDloader stcd = new SoloThreadConsoleDloader();
				stcd.getThingsMoving();
			} else {
				// GUI section startup 
				SwingUtilities.invokeAndWait(new Runnable() {
					@Override
					public void run() {
						gui = new GUI();
						gui.init(baseURL, saveTo, logger != null, allowFromCache, forceTagging);
						gui.pack();
						gui.setSize(750, 950);
						gui.setVisible(true);
					}
				});
				
				gui.getEventDispatchThread().join(); // wait till GUI closes
			}
			
			cache.saveCache();
			
			logger.info( String.format("On total: %d files saved from net (%d bytes) + %d pages viewed%n", 
					StatisticGatherer.totalFileDownloadFinished.intValue(), 
					StatisticGatherer.totalBytesDownloaded.longValue(),
					StatisticGatherer.totalPageDownloadFinished.intValue() 
					));
		} catch (Throwable e) {
			try {
				// an attempt to salvage metadata at least
				cache.saveCache();
			} catch (IOException e1) {
				logger.log(Level.SEVERE, "", e1);
			} finally {
				logger.log(Level.SEVERE, "", e);
			}
		}
	}