Deprecated in iOS 10.0: os_log(3) has replaced asl(3)
So iOS 10.0 apparently deprecates the asl (Apple System Log) api and replaces it with the very limited os_log api.
I use something similar to the code snippet below to read out log writes for the running app to show in a uitextview in app - and now it is full of deprecation warnings. Does anyone know of a way to read the printed log using the new os_log api? Because I only see an api for writing (https://developer.apple.com/reference/os/1891852-logging).
import asl
let query = asl_new(UInt32(ASL_TYPE_QUERY))
let response = asl_search(nil, query)
while let message = asl_next(response) {
var i: UInt32 = 0
let key = asl_key(message, i)
print(asl_get(message, key))
...
}
Edit after @Will Loew-Blosser's answer
https://developer.apple.com/videos/play/wwdc2016/721/ explained nicely what is going to happen with logging in the future. The biggest giveaway was that logs are put in some compressed format and only expanded by the new Console application. Which pretty much makes my mission hopeless.
The guy (Steve Szymanski) in the video mentions "All ASL logging APIs are superseeded by new APIs" and "New APIs for searching new log data will not be made public this release" aka asl_search
. And that was exactly what I was looking for!
Also he mentions that a swift API i coming.