3


is there a way to clear console output from code?

thanks.

1
  • You could delete the log file. Commented Jan 24, 2011 at 9:26

3 Answers 3

4

SHORTCUT I PREFER :

Simply USE +K Keyboard Shortcut when you want to clear the NSLOG Data.

Sign up to request clarification or add additional context in comments.

Comments

0

I don't think it's possible to do that in code.

Though there is an option in XCode preferences (Debugging tab) called Auto Clear Debug Console. It will clear console output each time you run the application. That might fit your needs.

Comments

0

If you search the site, you will find several ways of manipulating NSLog. I use

#ifndef __OPTIMIZE__
#    define NSLog(...) NSLog(__VA_ARGS__)
#else
#    define NSLog(...) {}
#endif

to kill the output. Put the above in your .pch file in your 'Other Sources' folder and it works out of the box for release builds. Replace OPTIMIZE with some other preprocessing flag if you want this to work for other build configurations.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.