0

I am of getting a JSON response on clicking NEXT and BACK buttons on simulator, each time it calls a service, I am printing that JSON response using print statement

print(jsonResponse)

It keeps adding a huge data on debugger.

Is there any way by which I can clear the debugger logs before printing the new? Something like this:

clearDebuggerLogs()    //clrscr() in C

print(jsonResponse)
  • Follow this link: https://stackoverflow.com/questions/37930506/xcode-8-console-garbage – Sagar Chauhan Mar 23 '18 at 05:06
  • @PaulMarshal this one disables the normal logs also while using a real device –  Mar 23 '18 at 05:09
  • A simple way without adding or removing anything is to set a breakpoint on `print(jsonResponse)`. When the application hits the breakpoint, press `clear the console` button (trash bin icon) which will clear out the console and then resume the application – Malik Mar 23 '18 at 05:32
  • @Malik is right. – Sagar Chauhan Mar 23 '18 at 05:44
  • @Malik @PaulMarshal this is what I'm doing now, however this process is irritating when I have to do it frequently. It was pretty easy in C language, just `clrscr()` and done! –  Mar 23 '18 at 06:06
  • I suppose you can do something like `(1...50).forEach({ _ in print() })`. Basically adding empty lines which is a very crude way of doing it. – Malik Mar 23 '18 at 06:15

0 Answers0