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

wrong names bug fix #226

Merged
Merged
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
9 changes: 5 additions & 4 deletions src/main/java/seedu/address/commons/core/LogsCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
* Configures and manages loggers and handlers, including their logging level
* Named {@link Logger}s can be obtained from this class<br>
* These loggers have been configured to output messages to the console and a {@code .log} file by default,
* at the {@code INFO} level. A new {@code .log} file with a new numbering will be created after the log
* file reaches 5MB big, up to a maximum of 5 files.<br>
* at the {@code INFO} level. A new {@code .log} file with a new numbering will be created after the log
* file reaches 5MB big, up to a maximum of 5 files.<br>
*/
public class LogsCenter {
private static final int MAX_FILE_COUNT = 5;
private static final int MAX_FILE_SIZE_IN_BYTES = (int) (Math.pow(2, 20) * 5); // 5MB
private static final String LOG_FILE = "addressbook.log";
private static final String LOG_FILE = "hospirecord.log";
private static Level currentLogLevel = Level.INFO;
private static final Logger logger = LogsCenter.getLogger(LogsCenter.class);
private static FileHandler fileHandler;
Expand Down Expand Up @@ -75,7 +75,7 @@ private static void addConsoleHandler(Logger logger) {
*/
private static void removeHandlers(Logger logger) {
Arrays.stream(logger.getHandlers())
.forEach(logger::removeHandler);
.forEach(logger::removeHandler);
}

/**
Expand All @@ -95,6 +95,7 @@ private static void addFileHandler(Logger logger) {

/**
* Creates a {@code FileHandler} for the log file.
*
CedricPei marked this conversation as resolved.
Show resolved Hide resolved
* @throws IOException if there are problems opening the file.
*/
private static FileHandler createFileHandler() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class ClearCommand extends Command {

public static final String COMMAND_WORD = "clear";
public static final String MESSAGE_SUCCESS = "Address book has been cleared!";
public static final String MESSAGE_SUCCESS = "Records have been cleared!";


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class DeleteBackupCommand extends Command {
public static final String COMMAND_WORD = "deletebackup";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes a backup from a specified slot\n "
+ "Parameters: INDEX (backup must exist in that index)\n "
+ "Example: " + COMMAND_WORD
+ " 3";
+ ": Deletes a backup from a specified slot\n "
+ "Parameters: INDEX (backup must exist in that index)\n "
+ "Example: " + COMMAND_WORD
+ " 3";

public static final String MESSAGE_SUCCESS = "Backup deleted from: index %1$d";
public static final String DELETE_ERROR = "Error deleting file!";
Expand All @@ -41,9 +41,9 @@ public class DeleteBackupCommand extends Command {
public DeleteBackupCommand(Index index) {
requireAllNonNull(index);
this.index = index;
this.backupLocation = Path.of("data/backup/addressbookBackup"
+ index.getOneBased()
+ ".json");
this.backupLocation = Path.of("data/backup/hospirecordBackup"
+ index.getOneBased()
+ ".json");
}

@Override
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/seedu/address/model/backup/Backup.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ public static boolean isValidIndex(Index test) {
* @param index Index of backup
*/
public String getBackupLocation(Index index) {
return "data/backup/addressbookBackup"
+ index.getOneBased()
+ ".json";
return "data/backup/hospirecordBackup"
+ index.getOneBased()
+ ".json";
}

/**
Expand Down Expand Up @@ -102,8 +102,8 @@ public String backupTimeToString() {
@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
|| (other instanceof Backup // instanceof handles nulls
&& this.index.equals(((Backup) other).index)) // state check
&& Objects.equals(this.backupLocation, ((Backup) other).backupLocation);
|| (other instanceof Backup // instanceof handles nulls
&& this.index.equals(((Backup) other).index)) // state check
&& Objects.equals(this.backupLocation, ((Backup) other).backupLocation);
}
}