Class LazyBackend

java.lang.Object
edu.wpi.first.epilogue.logging.LazyBackend
All Implemented Interfaces:
EpilogueBackend

public class LazyBackend extends Object implements EpilogueBackend
A backend implementation that only logs data when it changes. Useful for keeping bandwidth and file sizes down. However, because it still needs to check that data has changed, it cannot avoid expensive sensor reads.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new lazy backend wrapper around another backend.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets a backend that can be used to log nested data underneath a specific path.
    Creates a lazy version of this backend.
    void
    log(String identifier, boolean value)
    Logs a boolean data point.
    void
    log(String identifier, boolean[] value)
    Logs a boolean array data point.
    void
    log(String identifier, byte[] value)
    Logs a raw byte array data point.
    void
    log(String identifier, double value)
    Logs a 64-bit floating point data point.
    void
    log(String identifier, double[] value)
    Logs a 64-bit floating point array data point.
    void
    log(String identifier, float value)
    Logs a 32-bit floating point data point.
    void
    log(String identifier, float[] value)
    Logs a 32-bit floating point array data point.
    void
    log(String identifier, int value)
    Logs a 32-bit integer data point.
    void
    log(String identifier, int[] value)
    Logs a 32-bit integer array data point.
    void
    log(String identifier, long value)
    Logs a 64-bit integer data point.
    void
    log(String identifier, long[] value)
    Logs a 64-bit integer array data point.
    void
    log(String identifier, String value)
    Logs a text data point.
    void
    log(String identifier, String[] value)
    Logs a string array data point.
    <S> void
    log(String identifier, S[] value, Struct<S> struct)
    Logs an array of struct-serializable objects.
    <S> void
    log(String identifier, S value, Struct<S> struct)
    Logs a struct-serializable object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface edu.wpi.first.epilogue.logging.EpilogueBackend

    log, log, log, log, log
  • Constructor Details

    • LazyBackend

      public LazyBackend(EpilogueBackend backend)
      Creates a new lazy backend wrapper around another backend.
      Parameters:
      backend - the backend to delegate to
  • Method Details

    • lazy

      Description copied from interface: EpilogueBackend
      Creates a lazy version of this backend. A lazy backend will only log data to a field when its value changes, which can help keep file size and bandwidth usage in check. However, there is an additional CPU and memory overhead associated with tracking the current value of every logged entry. The most surefire way to reduce CPU and memory usage associated with logging is to log fewer things - which can be done by opting out of logging unnecessary data or increasing the minimum logged importance level in the Epilogue configuration.
      Specified by:
      lazy in interface EpilogueBackend
      Returns:
      the lazy backend
    • getNested

      Description copied from interface: EpilogueBackend
      Gets a backend that can be used to log nested data underneath a specific path.
      Specified by:
      getNested in interface EpilogueBackend
      Parameters:
      path - the path to use for logging nested data under
      Returns:
      the nested backend
    • log

      public void log(String identifier, int value)
      Description copied from interface: EpilogueBackend
      Logs a 32-bit integer data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, long value)
      Description copied from interface: EpilogueBackend
      Logs a 64-bit integer data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, float value)
      Description copied from interface: EpilogueBackend
      Logs a 32-bit floating point data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, double value)
      Description copied from interface: EpilogueBackend
      Logs a 64-bit floating point data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, boolean value)
      Description copied from interface: EpilogueBackend
      Logs a boolean data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, byte[] value)
      Description copied from interface: EpilogueBackend
      Logs a raw byte array data point. NOTE: serializable data should be logged using EpilogueBackend.log(String, Object, Struct).
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, int[] value)
      Description copied from interface: EpilogueBackend
      Logs a 32-bit integer array data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, long[] value)
      Description copied from interface: EpilogueBackend
      Logs a 64-bit integer array data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, float[] value)
      Description copied from interface: EpilogueBackend
      Logs a 32-bit floating point array data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, double[] value)
      Description copied from interface: EpilogueBackend
      Logs a 64-bit floating point array data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, boolean[] value)
      Description copied from interface: EpilogueBackend
      Logs a boolean array data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, String value)
      Description copied from interface: EpilogueBackend
      Logs a text data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public void log(String identifier, String[] value)
      Description copied from interface: EpilogueBackend
      Logs a string array data point.
      Specified by:
      log in interface EpilogueBackend
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
    • log

      public <S> void log(String identifier, S value, Struct<S> struct)
      Description copied from interface: EpilogueBackend
      Logs a struct-serializable object.
      Specified by:
      log in interface EpilogueBackend
      Type Parameters:
      S - the serializable type
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
      struct - the struct to use to serialize the data
    • log

      public <S> void log(String identifier, S[] value, Struct<S> struct)
      Description copied from interface: EpilogueBackend
      Logs an array of struct-serializable objects.
      Specified by:
      log in interface EpilogueBackend
      Type Parameters:
      S - the serializable type
      Parameters:
      identifier - the identifier of the data point
      value - the value of the data point
      struct - the struct to use to serialize the objects