-
Notifications
You must be signed in to change notification settings - Fork 0
Debugging
The main method of debugging is the Logger, a scrolling console which proves superior to the built-in telemetry. The logger must obviously be initialized, but after that, one only needs to call:
Logger.logLine("Stuff works.", 1);to add a message to the debugger/logger. Because it's static, any component can add messages to the logger.
There are two arguments to logLine:
-
String contents- the message to say -
int priority- (optional) the priority of filtering. Defaults to 1.
You can also filter out low-priority messages by calling Logger.setMode(int mode).
Closer to 1 is high priority, higher numbers is lower priority. A small log level would likely be 1, while a verbose log level would be 10. It is up to you what your priority should be.
If you want to log to a .csv file, use Logger.logFile("key", "value,value").
For making advanced UIs, construct a list of lines yourself, and feed it using Logger.logLines(ArrayList<String>);.
To mimic the original key-value behavior of telemetry, just use Logger.addData("key", "value");
To clear the logger, call Logger.clear().
See also: Testing
