Class Logging
java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.persistency.Logging
This utility class is responsible for saving and loading logs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA record that represents a log entry. -
Method Summary
-
Method Details
-
log
Log the string to the log file.- Parameters:
message- The string to log- Throws:
IOException- If the file cannot be written to
-
getLogs
Get a list of all the logs. The log file exists at res/logs.txt- Returns:
- List of log entries
- Throws:
IOException- If the file cannot be read
-
clearLogs
public static boolean clearLogs()Clear the log file.- Returns:
- Whether the operation was successful
-