forked from nusCS2113-AY1920S1/PersonalAssistant-Duke
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from tatayu/master
Add Logging Support
- Loading branch information
Showing
9 changed files
with
108 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
|
||
Nov 11, 2019 9:22:05 PM dolla.Dolla main | ||
INFO: Running dolla.......... | ||
Nov 11, 2019 9:22:05 PM dolla.storage.StorageRead load | ||
INFO: Save file successfully loaded | ||
Nov 11, 2019 9:22:23 PM dolla.parser.Parser verifyAddCommand | ||
SEVERE: Invalid entry format. | ||
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 | ||
at dolla.parser.Parser.verifyAddCommand(Parser.java:160) | ||
at dolla.parser.EntryParser.parseInput(EntryParser.java:30) | ||
at dolla.parser.MainParser.handleInput(MainParser.java:50) | ||
at dolla.Dolla.run(Dolla.java:45) | ||
at dolla.Dolla.main(Dolla.java:54) | ||
|
||
Nov 11, 2019 9:24:14 PM dolla.Dolla main | ||
INFO: ***********************DOLLA RUNNING*********************** | ||
Nov 11, 2019 9:24:14 PM dolla.storage.StorageRead load | ||
INFO: Save file successfully loaded. | ||
Nov 11, 2019 9:24:22 PM dolla.Dolla run | ||
INFO: ***********************DOLLA TERMINATED*********************** | ||
Nov 11, 2019 9:29:05 PM dolla.Dolla main | ||
INFO: ***********************DOLLA RUNNING*********************** | ||
Nov 11, 2019 9:29:05 PM dolla.storage.StorageRead load | ||
INFO: Save file successfully loaded. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package dolla; | ||
|
||
import java.io.IOException; | ||
import java.util.logging.FileHandler; | ||
import java.util.logging.Level; | ||
import java.util.logging.LogManager; | ||
import java.util.logging.Logger; | ||
import java.util.logging.SimpleFormatter; | ||
|
||
|
||
public class LogsCentreUtil { | ||
|
||
public static final Logger setLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); | ||
|
||
/** | ||
* SEVERE > WARNING > INFO > CONFIG > FINE > FINER > FINEST | ||
* This method will setup the log to be stored in data. | ||
*/ | ||
public static void logSetter() { | ||
LogManager.getLogManager().reset(); | ||
setLogger.setLevel(Level.ALL); | ||
try { | ||
FileHandler fh = new FileHandler("./data/dollaLogger.log",true); | ||
fh.setLevel(Level.INFO); | ||
fh.setFormatter(new SimpleFormatter()); | ||
setLogger.addHandler(fh); | ||
} catch (IOException e) { | ||
setLogger.log(Level.SEVERE,"File logger not working", e); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters