Currently, I am using the Logback bindings for SLF4J and I am wondering if there is a way to have it call DriverStation.reportError() when I log an Error and likewise for warnings. Worst case scenario I can write an extension of the Logback implementation of org.slf4j.Logger, but is there an easier way to do this?
Did you ever get this to work? I like the external Java logging mechanisms, but I want to be able to see them on the Driver Station
In order to write an error to the log, you have to catch it first. Use try/catch process to catch the error (handle error) and then report it to the DS.
https://docs.oracle.com/javase/tutorial/essential/exceptions/catch.html
Better Tutorial
https://www.javatpoint.com/try-catch-block