<commit_before>package org.lodder.subtools.multisubdownloader;

import java.awt.EventQueue;
import java.io.File;
import java.util.concurrent.TimeUnit;
import java.util.prefs.Preferences;

import javax.swing.UIManager;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.lodder.subtools.multisubdownloader.framework.Bootstrapper;
import org.lodder.subtools.multisubdownloader.framework.Container;
import org.lodder.subtools.multisubdownloader.gui.Splash;
import org.lodder.subtools.multisubdownloader.settings.SettingsControl;
import org.lodder.subtools.multisubdownloader.settings.model.Settings;
import org.lodder.subtools.sublibrary.ConfigProperties;
import org.lodder.subtools.sublibrary.Manager;
import org.lodder.subtools.sublibrary.cache.DiskCache;
import org.lodder.subtools.sublibrary.cache.InMemoryCache;
import org.lodder.subtools.sublibrary.util.http.CookieManager;
import org.lodder.subtools.sublibrary.util.http.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.qos.logback.classic.Level;

public class App {

  private final static SettingsControl prefctrl = new SettingsControl();
  private static Splash splash;
  private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

  /**
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    setLogLevel(Level.INFO);

    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

    CommandLineParser parser = new GnuParser();
    HelpFormatter formatter = new HelpFormatter();

    CommandLine line = null;
    try {
      line = parser.parse(getCLIOptions(), args);
    } catch (ParseException e) {
      LOGGER.error("Unable to parse cli options", e);
    }

    if (line == null) {
      return;
    }

    if (!line.hasOption("nogui")) {
      splash = new Splash();
      splash.showSplash();
    }

    Preferences preferences = Preferences.userRoot();
    preferences.putBoolean("speedy", line.hasOption("speedy"));

    final Container app = new Container();
    final Manager manager = createManager();
    Bootstrapper bootstrapper = new Bootstrapper(app, prefctrl.getSettings(), preferences, manager);

    if (line.hasOption("help")) {
      formatter.printHelp(ConfigProperties.getInstance().getProperty("name"), getCLIOptions());
      return;<commit_msg>Configure default log level in xml file<commit_after>package org.lodder.subtools.multisubdownloader;

import java.awt.EventQueue;
import java.io.File;
import java.util.concurrent.TimeUnit;
import java.util.prefs.Preferences;

import javax.swing.UIManager;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.lodder.subtools.multisubdownloader.framework.Bootstrapper;
import org.lodder.subtools.multisubdownloader.framework.Container;
import org.lodder.subtools.multisubdownloader.gui.Splash;
import org.lodder.subtools.multisubdownloader.settings.SettingsControl;
import org.lodder.subtools.multisubdownloader.settings.model.Settings;
import org.lodder.subtools.sublibrary.ConfigProperties;
import org.lodder.subtools.sublibrary.Manager;
import org.lodder.subtools.sublibrary.cache.DiskCache;
import org.lodder.subtools.sublibrary.cache.InMemoryCache;
import org.lodder.subtools.sublibrary.util.http.CookieManager;
import org.lodder.subtools.sublibrary.util.http.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.qos.logback.classic.Level;

public class App {

  private final static SettingsControl prefctrl = new SettingsControl();
  private static Splash splash;
  private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

  /**
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

    CommandLineParser parser = new GnuParser();
    HelpFormatter formatter = new HelpFormatter();

    CommandLine line = null;
    try {
      line = parser.parse(getCLIOptions(), args);
    } catch (ParseException e) {
      LOGGER.error("Unable to parse cli options", e);
    }

    if (line == null) {
      return;
    }

    if (!line.hasOption("nogui")) {
      splash = new Splash();
      splash.showSplash();
    }

    Preferences preferences = Preferences.userRoot();
    preferences.putBoolean("speedy", line.hasOption("speedy"));

    final Container app = new Container();
    final Manager manager = createManager();
    Bootstrapper bootstrapper = new Bootstrapper(app, prefctrl.getSettings(), preferences, manager);

    if (line.hasOption("help")) {
      formatter.printHelp(ConfigProperties.getInstance().getProperty("name"), getCLIOptions());
      return;
{'fraction_non_alphanumeric': 0.11007025761124122, 'fraction_numerical': 0.00078064012490242, 'mean_word_length': 4.8106575963718825, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2018819', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1546, 'n_words': 294}