Log in xCode (Mac)

Log in xCode (Mac)
0

Hi guys,

I am new and testing out cocos2d. I tried a few tutorials and the graphics appear nicely.

But I am unable to view any log in Console when I use ‘cclog’ & ‘log’. How do i view logs printed out in my program on Mac ?

If you have to ask how to use logging, I’d suggest going through our Basic Concepts and perhaps also a c++ tutorial because at least you could have thought to use std::cout. If you are new to programming in c++, there is no shortcut to learning the foundation before jumping into a project like a game. Game development will surely push the boundaries of what you know and the programming language itself.

@yosu2s The default log system writes to standard out, so it probably depends how you start your apps. If you start them by selecting the app icon then no console is spawned and the output is lost. However you could start a new Terminal and use open /path/to/your/game.app or open game.app and you should see the output.

Another alternative I use is to subvert the logging system altogether and get it to use a function pointer to call when CCLOG() or log() is called, and this function then writes to my own log files. I did a PR with this change in the past, but it was rejected :slight_smile:

-A

But he said from Xcode…

You are right; I missed that. It’s strange the output would stop working in the Xcode console.

It works for me in Xcode currently.

Me too, building using cmake.

In XCode, in menu, click view, then click debug area, click show debug.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.