I am aware that the new unified logging and tracing system captures system messages which can be analysed within XCode's console. What mechanism can be used to read these messages within code?
In particular, I wish to capture messages denoting when any app on the device moves into, or out of, foreground mode. The general idea is to retrieve and filter messages stored on the device each time the app I'm developing moves into the foreground itself. This information will be used to monitor user activity to determine which apps they've used over a specified period of time.
If it's not possible to use the logging system for this purpose, are you able to propose a mechanism by which this could be achieved?
Thank you