UPM is a high level repository that provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform through calls to MRAA APIs.
I like this implementation - UPM needs a unified logging scheme.
Is there a means to use this in the UPM C source?
Let's add a set of unit tests to verify everything works as expected and ensure coverage.
Make sure to document the logger class/methods.
It would be nice to have some control over the target file (whether that's /dev/stdout, ./localfile.log, /tmp/someotherfile.log)
Some formatting ideas below (it would be nice to have an optional classname in there if a method belongs to a class). If we're talking one log file for all binaries built from UPM, then we most likely would need to add either a pid or executable name to differentiate them.
[2018.06.07 10:54:40.638] [WARNING] filename.cxx:10 (ClassName::)function "My error message to log"
[2018.06.07 10:54:40.638] [DEBUG ] filename.cxx:10 (ClassName::)function "My debug message to log"
If this logging implementation existed in mraa, both projects could benefit. Thoughts?
I like this implementation - UPM needs a unified logging scheme.
Some formatting ideas below (it would be nice to have an optional classname in there if a method belongs to a class). If we're talking one log file for all binaries built from UPM, then we most likely would need to add either a pid or executable name to differentiate them.
If this logging implementation existed in mraa, both projects could benefit. Thoughts?