|
Re: Logging Data in Java
I'm a little confused as to what you mean by logging in this case. Are you talking about logging exceptions, logging that things happened, or logging things like sensor values at specific times?
1) In general, sure it's possible to log other things. For example, let's say you want to log where an elevator motor is before/after you adjust its position. You could get the value of whatever sensor is attached to the elevator and print it out. You can also write it to a file if you want, you have all of Java IO at your disposal this year.
2) Some of the benefits of logging are knowing what happened if things go wrong. For example, the roboRIO will let you know if it enters brown-out mode, and it is currently logging the current draw on each of the individual ports on the PDP to the DS log file. The log viewer doesn't display this currently, but the hope is to have it display for competition season. This will let you know if a motor suddenly starts drawing way more current than it should be, so there could be an issue with the motor or the mechanical system it's attached to. You might also log conditions internally. You might have some a complicated command or command group that does a whole bunch of things, logging would tell you where in the command you are, and if you experience issues with the command, you know where things started to go wrong.
3) Depends on how much you log. Generally, if you're just logging via println, you're going to overload the human trying to read the log output far faster than you will overload the processor. Too much data can be a bad thing when you're trying to understand what happened. Even if you're writing logs to a file with some advanced logging framework, you'll probably overwhelm yourself much faster than you overwhelm the roboRIO.
4) I hope that my other answers clarified this one for you.
|