Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get asl_log to appear in the iOS system console output?

I'm investigating whether I can get better performance from asl_log than NSLog on iPhone/iOS (probably...) but I'm stuck at a point where it doesn't seem that asl's log output will show up in the System Console (as viewable by a number of apps like System Console, iConsole, etc). I know that I'm setting it up right since I open with ASL_OPT_STDERR, and I see the log entries in XCode when the device is tethered.

I've explored lots of interesting stuff online (e.g. http://boredzo.org/blog/archives/2008-01-20/asl-logging, https://github.com/robbiehanson/CocoaLumberjack) and the best hope seemed to be asl_open() with Facility of "com.apple.console" but alas, the output still doesn't show up in Console. Is NSLog the only option?

like image 575
Marc Lindahl Avatar asked Jan 07 '13 18:01

Marc Lindahl


1 Answers

Add STDERR to ASL and then it shows up in the console

asl_add_log_file(NULL, STDERR_FILENO);
like image 58
Colin Wheeler Avatar answered Sep 30 '22 16:09

Colin Wheeler