Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System log messages no longer displayed on iOS 10 #140

Closed
andreyz opened this issue Aug 3, 2016 · 18 comments
Closed

System log messages no longer displayed on iOS 10 #140

andreyz opened this issue Aug 3, 2016 · 18 comments

Comments

@andreyz
Copy link

andreyz commented Aug 3, 2016

On iOS 10 betas 1-4 no log messages are displayed. Probably due to introduced Unified Logging and Activity Tracing?

@ryanolsonk
Copy link
Member

Yea, it looks like ASL has been replaced by OS Log. We'll need to provide conditional support for iOS 10+.

@coderyi
Copy link

coderyi commented Oct 29, 2016

I also have this problem ,hope to resolve this

@Huang-Libo
Copy link

Looking forward to the enhancement

@iunion
Copy link

iunion commented Aug 1, 2017

Same problem with iphone7/p, but iphone6/p can output logs.

@CodeLife2012
Copy link
Contributor

Solved?

@JustDoEat
Copy link

same problem and I use the GHConsole the repository in GitHub to solve this problem. https://github.com/Liaoworking/GHConsole

@CodeLife2012
Copy link
Contributor

I have a idea and test in a simple project, maybe anyone can add it to Flex. Use pipes to redirect and capture stdout and stderror.

@rob2468
Copy link

rob2468 commented Apr 8, 2018

Read logs using the new swift os_log api
"New APIs for searching new log data will not be made public this release".
Seems no way to query logs with new api in os/log.h.

@NSExceptional
Copy link
Collaborator

Is this still broken? I'm on iOS 11 and it seems to be working fine, but I am jailbroken

@AnthoPakPak
Copy link
Contributor

@NSExceptional Yes it still appears to be broken for me, even on my jailbroken device (iOS 11.3.1)

@xingheng
Copy link

xingheng commented Oct 9, 2018

Same here in iOS 12.0

@PhilCai1993
Copy link

PhilCai1993 commented Oct 25, 2018

This may be an alternative.

@NSExceptional
Copy link
Collaborator

Thank you! I'll look into that. This bug is killing me.

@NSExceptional
Copy link
Collaborator

@CodeLife2012 I don't believe NSLog writes to either of the standard outputs, so I'm not sure how useful that would be. That appears to be what the link by @PhilCai1993 is doing as well.

@codwam
Copy link

codwam commented Dec 20, 2018

Is there any solution?
Swizzle NSLog or print method support?

@NSExceptional
Copy link
Collaborator

There is no way to swizzle a function. I'm looking into other means currently

@FLEXTool FLEXTool deleted a comment from pegurov Mar 3, 2019
@FLEXTool FLEXTool deleted a comment from nenhall Mar 3, 2019
@FLEXTool FLEXTool deleted a comment from riverlj Mar 3, 2019
@FLEXTool FLEXTool deleted a comment from TristenChenTao Mar 3, 2019
@FLEXTool FLEXTool deleted a comment from LittleChuan Mar 3, 2019
@FLEXTool FLEXTool deleted a comment from gjterry Mar 3, 2019
NSExceptional added a commit to NSExceptional/FLEX that referenced this issue Mar 14, 2019
NSExceptional added a commit to NSExceptional/FLEX that referenced this issue Mar 14, 2019
NSExceptional added a commit to NSExceptional/FLEX that referenced this issue Mar 20, 2019
NSExceptional added a commit to NSExceptional/FLEX that referenced this issue Mar 21, 2019
@NSExceptional
Copy link
Collaborator

NSExceptional commented Mar 25, 2019

Ugh, I always forget that referencing an issue makes it pop up here.

Anyway, I've got logs working on iOS 10+, but there's a problem. OS Log doesn't provide a way to get old messages the way ASL does. In ASL, you could query the log like a database and get every single message since the app launched. With OS Log, it seems we have to continuously monitor it to get logs.

I'd love some feedback on what we should do about that, because it's not very useful to only see the logs that appear as you're viewing the log in FLEX. I'm thinking maybe monitor on launch and write the logs to a file that gets purged on the next launch? But if there's a lot of logs, it could be costly to use a simple text file for storage.

NSExceptional added a commit to NSExceptional/FLEX that referenced this issue Mar 30, 2019
NSExceptional added a commit to NSExceptional/FLEX that referenced this issue Mar 30, 2019
NSExceptional added a commit to NSExceptional/FLEX that referenced this issue Mar 30, 2019
@NSExceptional
Copy link
Collaborator

NSExceptional commented Mar 30, 2019

Alright, I've finally fixed this. I've added two new classes: FLEXASLLogController and FLEXOSLogController, and FLEX will use the appropriate class based on your iOS version.

There's a caveat though. OS Log is much more limited that ASL. ASL worked transparently like a database; you could simply ask it for every log message so far and you would get them all back, and it's reasonable to assume that ASL doesn't count against your memory limit. OS Log, however, has no such API to my knowledge. You can only simply intercept messages as they come in.

So, on iOS 10+, there will be a Settings button in the navigation bar. If you press it, it will explain this to you and give you the option to turn what I'm calling "persistent logging" on or off. With persistent logging on, log messages will be stored in memory in the background from the moment the app launches, until it is turned off or the app closes. It defaults to off.


Here is where I got the technique to fix this, and this is what I assume he used to reverse engineer the API. Because it is a private API.

timonus pushed a commit to timonus/FLEX that referenced this issue May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

14 participants