A better implemetation of cc.log

A better implemetation of cc.log
0.0 0


In chrome, console.log can have multiple parameters, and will show them with their properties gracefully in console as the screenshot.

This feature is quite convenient for debuging, but the current implementation of cc.log can only show the first parameter. a better implementation taking full advantage of chrome’s console.log is:

cc.log = function (message) {
    if (!cc.IS_SHOW_DEBUG_ON_PAGE) {
        console.log.apply(console, arguments);
    } else {

屏幕快照 2013-11-24 上午12.43.05.png (31.0 KB)


Thanks very much, Jie.

Could you please send a pull request to our “develop” branch on github.



Hi Jie,

These codes have been updated, more details at: https://github.com/cocos2d/cocos2d-html5/pull/1285

Thanks very much