Log Less
Description
I wanted to remove some log messages that I don't think are necessary, but that I do find annoying because they show up so frequently. I added the SystemLoggerHelper class to the SystemLogger.cs file to make this easier and to not have repeated code.
For context, the SystemLogger has different levels of severity, from NONE to CRITICAL. You can set the SystemLogger.DebugLevel to filter what level of severity you want to get through globally. (SystemLogger can be thought of as a static class, in the sense that it uses the singleton design pattern to ensure that there is only one instance of it. In that way, every parameter attached to it is "global".) However, it should often be more useful to change this setting for a specific object, so for example you only see DEBUG level messages from the HapticChangingSphere and nothing else. Any object that uses SystemLoggerHelper can have its own specific log severity level for its output, which will then also be filtered by the global SystemLogger severity level.
I only added the SystemLoggerHelper to the objects I care about right now, because I am concerned with debugging guidance in FollowMe/Spotlight/Locks. This could be added to other classes in the future, if it proves to be useful.
What to focus on
- Check that I haven't missed editing any SystemLogger messages in the classes that I touched.
- Try triggering and looking for some of the important log messages in RobotController to confirm that we are still logging the messages that we want to.
- Following the way I set the RobotControllerSwitchable.Logger.Level in Example01-Console, try editing the Logger Level and ShowTags properties in another BurtSharp program and see that the logs change appropriately.