Package frc.lib5k.utils
Class RobotLogger
- java.lang.Object
-
- frc.lib5k.utils.RobotLogger
-
public class RobotLogger extends java.lang.Object
A threaded logger for use by all robot functions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RobotLogger.Level
Log level The kRobot level will immediately push to the console, everything else is queued until the next notifier cycle
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableUSBLogging(USBLogger logger)
Enable logging to a USBstatic RobotLogger
getInstance()
Get a RobotLogger instancevoid
log(java.lang.String msg)
Log a message to netconsole with the INFO log level.void
log(java.lang.String msg, RobotLogger.Level log_level)
void
log(java.lang.String component, java.lang.String msg)
void
log(java.lang.String component, java.lang.String msg, RobotLogger.Level log_level)
Logs a message to netconsole with a custom log level.void
start(double period)
Start the periodic logger
-
-
-
Method Detail
-
enableUSBLogging
public void enableUSBLogging(USBLogger logger)
Enable logging to a USB- Parameters:
logger
- USB logger object
-
start
public void start(double period)
Start the periodic logger- Parameters:
period
- The logging notifier period time in seconds
-
getInstance
public static RobotLogger getInstance()
Get a RobotLogger instance- Returns:
- The current RobotLogger
-
log
public void log(java.lang.String msg)
Log a message to netconsole with the INFO log level. This message will not be logged immediately, but instead through the notifier.- Parameters:
msg
- The message to log
-
log
public void log(java.lang.String msg, RobotLogger.Level log_level)
-
log
public void log(java.lang.String component, java.lang.String msg)
-
log
public void log(java.lang.String component, java.lang.String msg, RobotLogger.Level log_level)
Logs a message to netconsole with a custom log level. The kRobot level will immediately push to the console, everything else is queued until the next notifier cycle- Parameters:
msg
- The message to loglog_level
- the Level to log the message at
-
-