Extending the logger
DogLog was designed to be highly configurable, and in addition to the large set of options you can adjust, DogLog also allows you to extend the logger to add your own custom behavior.
This guide will walk you through the steps to create a custom logger class that allows you to add your own custom behavior.
As an example, we will add in a new log()
method to help log motor values.
Steps
-
Add DogLog to your project if you haven’t already:
-
Create a new file for your extended logger class:
Directorysrc
Directorymain
Directorydeploy/
- …
Directoryjava/
Directoryfrc/
Directoryrobot/
- CustomLogger.java Create this file
- Main.java
- Robot.java
- RobotContainer.java
-
In the newly created file, paste the following code:
-
Replace places where you use
DogLog
withCustomLogger
.