-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Print statements (Logs) #1021
Comments
Swift's print function does not print on release builds. |
These logs are mainly for the developer to know they have done something wrong during development. I don't really see a point in adding the complexity of a logging interface for something that will never effect release builds. |
Great thanks! I didn't know that Swift print statements aren't there on release builds. Do you have a link to any docs for this or have you been able to verify it? If this is the case totally agree that it's not necessary to wrap this (although I don't think it adds much more complexity). I'll try and test this out sometime myself but thanks for getting back to me. |
I ran into this when trying to implement VoIP notifications for an app. I was trying to print the token to the device logs while in release mode to manually send notifications to the phone but it wouldn't work unless I use NSLog. I wrote about it here |
To try it out run something with print ans NSLog on a device. Kill the debugger and rerun the app. Go to window > devices in Xcode and click the device. You shoul see all the devices log there. Search for you app name there and you will only see 1 log which is from NSLog. |
Hello there
Thanks for creating this library. I was wondering about some of the
print
andSwift.print
statements in the code base (mainly for tracking unhappy paths).Are those printed for Release builds too?
If we wanted to disable those print statements or allow people to enable or disable them what would be the best way?
Ideas: I'm thinking something like a
ChartsLogger
class with aprint
orlog
method. Also anenabled
parameter that can be configured by apps that use the framework?Let me know if this is something you'd be willing to accept a contribution for (or not) also whether it's being worked on already?
Thank you
The text was updated successfully, but these errors were encountered: