Class Logging

java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.persistency.Logging

public final class Logging extends Object
This utility class is responsible for saving and loading logs.
  • Method Details

    • log

      public static void log(String message) throws IOException
      Log the string to the log file.
      Parameters:
      message - The string to log
      Throws:
      IOException - If the file cannot be written to
    • getLogs

      public static List<Logging.Log> getLogs() throws IOException
      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