Class DataLogWriter

java.lang.Object
edu.wpi.first.util.datalog.DataLog
edu.wpi.first.util.datalog.DataLogWriter
All Implemented Interfaces:
AutoCloseable

public class DataLogWriter extends DataLog
A data log writer that flushes the data log to a file when flush() is called.
  • Constructor Details

    • DataLogWriter

      public DataLogWriter(String filename, String extraHeader) throws IOException
      Construct a new Data Log.
      Parameters:
      filename - filename to use
      extraHeader - extra header data
      Throws:
      IOException - if file cannot be opened
    • DataLogWriter

      public DataLogWriter(String filename) throws IOException
      Construct a new Data Log.
      Parameters:
      filename - filename to use
      Throws:
      IOException - if file cannot be opened
    • DataLogWriter

      public DataLogWriter(OutputStream os, String extraHeader)
      Construct a new Data Log with an output stream. Prefer the filename version if possible; this is much slower!
      Parameters:
      os - output stream
      extraHeader - extra header data
    • DataLogWriter

      Construct a new Data Log with an output stream.
      Parameters:
      os - output stream
  • Method Details

    • flush

      public void flush()
      Explicitly flushes the log data to disk.
      Overrides:
      flush in class DataLog