Apple iOS ASlog, polling for messages.. [code]
After reading these links: Usi开发者_JAVA百科ng Objective C to read log messages posted to the device console https://developer.apple.com/library/ios/#documentation/System/Conceptual/ManPages_iPhoneOS/man3/asl.3.html
I've successfully posted messages to the ASlog using
aslmsg m = asl_new(ASL_TYPE_MSG);
asl_log(NULL, m, ASL_LEVEL_INFO, result);
The problem is that when I go to query the log there is extreme lag in getting the results. It seems to be searching everything since I started printing with NSLog earlier today.
My current code to get the information is:
q = asl_new(ASL_TYPE_QUERY);
asl_set_query(q, ASL_KEY_SENDER, "db_poc", ASL_QUERY_OP_EQUAL);
asl_set_query(q, ASL_KEY_TIME, "1306768140", ASL_QUERY_OP_GREATER);
I'm trying to get my app to send messages to the console (from javascript/UIWebview). I want to then watch the console for these messages so I can send data back to the UIWebviews javascript code..
I wonder are there any extra flags I can set on either send or receive side to speed up things? Also, is there a way to clear this ASlog?
Any ideas..?
Thanks.
Have you tried creating your own aslclient using ASL_OPT_NO_DELAY?
精彩评论