-
Notifications
You must be signed in to change notification settings - Fork 18k
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
fmt, log: messages are not appearing on device log for darwin/arm,arm64 #12194
Comments
Is it easy for you to check if those messages appear on Android instead of iOS? |
On android we redirect stdout and stderr to logd (the system logger) because there is no way to get access to an app's stdout for debugging on a non-root android phone, the usual development environment. But that's not so on iOS, where stdout and stderr fit neatly with starting an app from inside Xcode. The attached lldb picks them up and drops them neatly in the output window, interleaved correctly with results from NSLog. So redirecting os.Stdout and os.Stderr as we do for android would be consistent but an unpleasant development experience, so I think the inconsistency is worth it. For the log package, there's a question: should we mirror the output to the system log? (We can do so quite easily by calling log.SetOutput(io.MultiWriter(os.Stdout, ...)).) I think we should match the behavior of NSLog here. Does it go to both? |
NSLog writes to ASL. ASL provides an option to write the same log to stderr. (man asl_open) |
CL https://golang.org/cl/13703 mentions this issue. |
Are you sure that it is working? I can't see any log output. $ go version |
I tested that a log.Printf line in example/basic appeared in the output of idevicesyslog, both starting from lldb and starting the app by clicking on the icon. What are you testing? (Note that fmt.Printf will not appear in idevicesyslog, as per my comment earlier on this issue.) |
I unfortunately can't see the log.Printf output on my device log by starting app by clicking on the icon. This is the main function I am testing:
Do you need any additional information about my device? |
Does your app import x/mobile/app? As this is a low priority issue, without a way to reproduce this I don't expect to get to this soon. |
I must have had an ASL faulty. I rebooted the device and I can see the messages are appearing on the log. Thanks. |
For anyone who comes across the same problem of not being able to see the logs, note that you need to relaunch idevicesyslog every time you launch a new application on the device. |
Fixes golang/go#12194 Change-Id: I9ff771336996c19ca43da56e3f8944e79c980a2b Reviewed-on: https://go-review.googlesource.com/13703 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Fixes golang/go#12194 Change-Id: I9ff771336996c19ca43da56e3f8944e79c980a2b Reviewed-on: https://go-review.googlesource.com/13703 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Update the x/mobile/example/basic.main to fmt.Println and log.Println.
Build and deploy the app to the device. Run
idevicesyslog
, launch the app.The expected result is to see "starting" and "log starting messages" to appear, even though there is no output from the example app.
/cc @crawshaw @hyangah @nigeltao
The text was updated successfully, but these errors were encountered: