3

Until iOS 10, we could use the asl framework (Apple System Log) to access log messages written by NSLog at runtime.

However, with iOS 10 Apple deprecated asl and replaced it with the new Logging framework.

Is it still possible to load messages logged by NSLog or the new Logging framework in iOS 10?

Note: I don't want to load all log messages, I just want the ones logged by my app

lukas
  • 2,300
  • 6
  • 28
  • 41

2 Answers2

0

For regular log message you can use print(), for the equivalent to asl you can use os_log()

import os

then

os_log("message")

source

Dominique Lorre
  • 1,168
  • 1
  • 10
  • 19
0

There may be private APIs to do this, but according to this presentation (page 173), there are no public APIs to search the logs:

New APIs for searching new log data will not be made public this release

• No equivalent asl_search functionality

They do say "this release" though, so maybe they'll be added at some point. I'm planning to look for private APIs to do this and will update my answer if I find any.

Shane Spoor
  • 423
  • 5
  • 11