While building an iOS app in Xcode, how do I set the log to show only what I print()?
I am wasting a huge amount of time sifting through garbage that looks like this
2016-10-18 06:26:49.455995 Lunch[1559:32097] subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0 2016-10-18 06:26:49.458682 Lunch[1559:32097] subsystem: com.apple.UIKit, category:
I end up using hacks like print("SEARCHFORME")
so I can use the find command and search for messages I need while debugging.
if you want to view logs from just your application then you can make a custom method that keeps saving the log to a file in documents directory & then you can view that log file from your application. There is one good advantage for developers of the app after the app has been released & users are downloading it.
Or #define NSLog (s,...) The console is hidden by default every time Xcode starts up. (I mean, when you start debugging, the debug area shows just the variables.) There's a button on the right hand end of the debugging toolbar to show the console, or you can use View menu -> Debug Area -> Activate Console.
NSString* url = @"someurlstring"; printf ("%s", [url UTF8String]); By using printf with the appropriate parameters, we can display things this way. This is the only way I have found to work on online Objective-C sandbox environments. In Swift with Xcode you can use either print () or NSLog (). print () just outputs your text. Nothing more.
This is the only way I have found to work on online Objective-C sandbox environments. In Swift with Xcode you can use either print () or NSLog (). print () just outputs your text. Nothing more. NSLog () additionally to your text outputs time and other useful info to debug console.
Go to ->
Edit Scheme -> Run -> Environment Variables -> set Name to - OS_ACTIVITY_MODE and Value to - disable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With