Search code examples
iphoneiosobjective-cxcodenslog

clear logs generated by NSlog from consol by code


I want to clear logs from consol by coding like we are using clrscr() in c language I am working on a navigation based application this application has too much logs generated by NSLog. When i feel that the code is working fine till now, i want to clear logs.

I got a solution from this question but this solution adds \n in the logs and i want to clear it completely so if you have any other solution please share with me.

thanks in advance i am waiting for your help.


Solution

  • I don't believe its possible to clear the console from inside your application.. However if you are developing in XCode, just click in the console output window and press cmd k - this will clear all of the scrollback...

    Alternatively - just disable the logging / wrap the nslog calls in another method that limits how much is displayed