Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging #88

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ checkstyle {
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
jvmArgs('-ea')
}

task coverage(type: JacocoReport) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CliSyntax.PREFIX_REMARK;

import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.commands.RemarkCommand;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Remark;

import java.util.logging.Logger;


/**
* Parses input arguments and creates a new {@code RemarkCommand} object
*/
public class RemarkCommandParser implements Parser<RemarkCommand> {
private static final Logger logger = LogsCenter.getLogger(RemarkCommandParser.class);


/**
* Parses the given {@code String} of arguments in the context of the {@code RemarkCommand}
Expand All @@ -35,8 +40,10 @@ public RemarkCommand parse(String args) throws ParseException {
Remark remark = new Remark(remarkText);

if (RemarkSyntaxHandler.isKeepRemark(args)) {
logger.fine("Keep remark syntax detected, remark kept accordingly");
return new RemarkCommand(index, remark, true);
}
logger.fine("Keep remark syntax not detected, replace with new remark");

return new RemarkCommand(index, remark);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ private CommandResult executeCommand(String commandText) throws CommandException
}

if (commandResult.isView()) {
logger.fine("View panel updating.... Viewing person at index " + logic.getLastViewedPersonIndex());
handleView();
}

Expand Down
Loading