<commit_before>package edu.pdx.cs410J.grader;

import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;

public class GraderTools {

  public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
    String tool = null;
    List<String> toolArgs = new ArrayList<>();
    for (String arg : args) {
      if (tool == null) {
        tool = arg;

      } else {
        toolArgs.add(arg);
      }
    }

    if (tool == null) {
      usage("Missing tool");
    }

    invokeMainMethod(getToolClass(tool), toolArgs.toArray(new String[toolArgs.size()]));
  }

  private static Class getToolClass(String tool) {
    switch (tool) {
      case "gradebook":
        return GradeBookGUI.class;

      case "fetch":<commit_msg>Configure the JUL Loggers to only print out the level name.<commit_after>package edu.pdx.cs410J.grader;

import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public class GraderTools {

  public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
    String tool = null;
    List<String> toolArgs = new ArrayList<>();
    for (String arg : args) {
      if (tool == null) {
        tool = arg;

      } else {
        toolArgs.add(arg);
      }
    }

    if (tool == null) {
      usage("Missing tool");
    }

    configureLogger();

    invokeMainMethod(getToolClass(tool), toolArgs.toArray(new String[toolArgs.size()]));
  }

  private static void configureLogger() {
    // Oddly enough, attempts to access the Logger end up causes a ClassNotFoundException
    System.setProperty("java.util.logging.SimpleFormatter.format", "%4$s %5$s%6$s%n");
  }

  private static Class getToolClass(String tool) {
    switch (tool) {
      case "gradebook":
        return GradeBookGUI.class;

      case "fetch":
{'fraction_non_alphanumeric': 0.1137370753323486, 'fraction_numerical': 0.004431314623338257, 'mean_word_length': 3.341880341880342, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2889810', 'n_tokens_mistral': 612, 'n_tokens_neox': 592, 'n_words': 153}