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 {
cc._logToWebPage(message);
}
};
屏幕快照 2013-11-24 上午12.43.05.png (31.0 KB)