Sometimes you will need to get a better look at your own debug messages or you will notice your application is running very slowly for no apparent reason. This could be caused by all the debug messages being written to the console. So, let's take a look at how to disable them:
Go to Project | Edit active target.
Search for gcc_preprocessor_defination, and you will find the flag COCOS2D_DEBUG set to 1.
Change it to 0 to disable it.
Rebuild your project.
Cocos2d debug messages will now disappear.
As debug messages are written to the console, many times when you have a lot of things going around in your game it will start running slowly. In such cases, you may want to prevent Cocos2d from logging all that useful data. If you follow the preceding steps you will be able to switch the debug logging on and off at will.