diff --git a/src/main/java/seedu/wildwatch/command/AddCommand.java b/src/main/java/seedu/wildwatch/command/AddCommand.java index e464ba3db6..6c3a0d0862 100644 --- a/src/main/java/seedu/wildwatch/command/AddCommand.java +++ b/src/main/java/seedu/wildwatch/command/AddCommand.java @@ -20,9 +20,9 @@ public class AddCommand extends Command { + "(?: R/(?[^/]+))?"); public static void addEntry(String inputBuffer, boolean isFromFile) throws IncorrectInputException { -// if (!isFromFile) { -// Ui.listMessagePrinter(); -// } + //if (!isFromFile) { + // Ui.listMessagePrinter(); + //} final Matcher matcher = ADD_ENTRY_COMMAND_FORMAT.matcher(inputBuffer); if (!matcher.matches()) { diff --git a/src/main/java/seedu/wildwatch/entry/EntryList.java b/src/main/java/seedu/wildwatch/entry/EntryList.java index 5dbbce87a7..84c9682c76 100644 --- a/src/main/java/seedu/wildwatch/entry/EntryList.java +++ b/src/main/java/seedu/wildwatch/entry/EntryList.java @@ -1,7 +1,6 @@ package seedu.wildwatch.entry; import java.time.LocalDate; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; public class EntryList { diff --git a/src/main/java/seedu/wildwatch/operation/Parser.java b/src/main/java/seedu/wildwatch/operation/Parser.java index a8a8860265..957e084bd0 100644 --- a/src/main/java/seedu/wildwatch/operation/Parser.java +++ b/src/main/java/seedu/wildwatch/operation/Parser.java @@ -1,7 +1,8 @@ package seedu.wildwatch.operation; import java.util.Scanner; - +import java.util.logging.Level; +import java.util.logging.Logger; import seedu.wildwatch.command.HelpCommand; import seedu.wildwatch.command.ListCommand; import seedu.wildwatch.command.DeleteCommand; @@ -12,11 +13,15 @@ public class Parser { private static final int DEFAULT_NUMBER_INPUT = -3710; //Number that can never be input in normal use of WildWatch + private static final Logger LOGGER = Logger.getLogger(Parser.class.getName()); + public static void manualInputHandler() { while (true) { String inputBuffer = Ui.inputRetriever(); //Retrieves input of user + LOGGER.log(Level.INFO, "Input received: {0}", inputBuffer); if (inputBuffer.equals("bye")) { //Program exit + LOGGER.log(Level.INFO, "Exiting program on user command."); break; } else if (inputBuffer.equals("help")) { //User request "help" Ui.printHorizontalLines(); @@ -29,11 +34,13 @@ public static void manualInputHandler() { Ui.printHorizontalLines(); } } + LOGGER.log(Level.INFO, "Initiating shutdown procedures."); ShutDown.shutDown(); } public static void entryManager(String inputBuffer, boolean isFromFile) throws UnknownInputException, IncorrectInputException { + LOGGER.log(Level.INFO, "Managing entry for input: {0}", inputBuffer); Scanner bufferScanner = new Scanner(inputBuffer); //Scanner for the buffer String firstWord = bufferScanner.next(); //Stores first word in the input assert firstWord != null && !firstWord.isEmpty() : "First word shouldn't be null or empty"; @@ -53,6 +60,7 @@ public static void entryManager(String inputBuffer, boolean isFromFile) } else if (inputBuffer.equals("list")) { ListCommand.listEntry(isFromFile); } else { + LOGGER.log(Level.WARNING, "Unknown input received: {0}. Throwing exception.", inputBuffer); throw new UnknownInputException(); //Unrecognizable by Parser } }