Package adaptlil

Class SimpleLogger

java.lang.Object
adaptlil.SimpleLogger

public class SimpleLogger extends Object
  • Field Details

  • Constructor Details

    • SimpleLogger

      public SimpleLogger(File outputFile)
      SimpleLogger is used to write logs to a file.
      Parameters:
      outputFile -
  • Method Details

    • logLine

      public void logLine(String line)
      Log the string into this SimpleLogger's output file.
      Parameters:
      line -
    • printAndLog

      public void printAndLog(String line, boolean disablePrependedTimestamp)
      Print line to System.out and log the line in this SimpleLogger's file w/ option to disable prependTimestamp.
      Parameters:
      line -
    • printAndLog

      public void printAndLog(String line)
      Prepends timestamp and print line to System.out and log the line in this SimpleLogger's file.
      Parameters:
      line -
    • printAndLog

      private void printAndLog(String line, PrintStream outStream, boolean disablePrependTimestamp)
      Prints w/ timestamp prepended
      Parameters:
      line - String to output to the stream and to log in SimpleLogger's log file
      outStream - Specify Printstream to output line to
    • getDateTimeStamp

      public String getDateTimeStamp()
      Return the current date and time formatted to yyyy-mm-dd hh:mm:ss
      Returns: