Package org.chsrobotics.lib.telemetry
Class Logger.LoggerFactory<U>
java.lang.Object
org.chsrobotics.lib.telemetry.Logger.LoggerFactory<U>
- Type Parameters:
U
- Data type of the loggers to create.
Factory class to simplify creating many similar logs at once.
-
Constructor Summary
ConstructorsConstructorDescriptionLoggerFactory
(edu.wpi.first.util.datalog.DataLog log, String subdirName, boolean publishToNT, boolean recordInLog) Constructs a LoggerFactory.LoggerFactory
(String subdirName) Constructs a Logger usingHighLevelLogger.getLog()
, publishing to NT and logging. -
Method Summary
-
Constructor Details
-
LoggerFactory
public LoggerFactory(edu.wpi.first.util.datalog.DataLog log, String subdirName, boolean publishToNT, boolean recordInLog) Constructs a LoggerFactory.All Loggers constructed with this factory will share these settings.
- Parameters:
log
- The DataLog to log values inside of, most likely fromHighLevelLogger.getInstance().getLog()
or whatever log is being used program-wide.subdirName
- The string name of the existing or new NetworkTables sub-table to write to.publishToNT
- Whether this should push logged values to NetworkTables.recordInLog
- Whether this should store logged values in an on-robot log file.
-
LoggerFactory
Constructs a Logger usingHighLevelLogger.getLog()
, publishing to NT and logging.- Parameters:
subdirName
- The string name of the existing or new NetworkTables sub-table to write to.
-
-
Method Details
-
getLogger
Constructs and returns a new logger with the parameters given above.- Parameters:
key
- A string identifier for the logged field.- Returns:
- A new Logger.
-
getLogger
Constructs and returns a new logger with the parameters given above.- Parameters:
key
- A string identifier for the logged field.lambda
- Lambda (of logged type) to use as initial data source.- Returns:
- A new Logger.
-