Merge pull request #5073 from ricardoquesada/console_log_fixes

Console::log(format, va_args) is private
This commit is contained in:
Ricardo Quesada 2014-01-15 11:19:17 -08:00
commit 567630fa47
4 changed files with 19 additions and 21 deletions

View File

@ -2,6 +2,7 @@ cocos2d-x-3.0final ?.? ?
[All]
[NEW] Console: added the 'textures', 'fileutils dump' and 'config' commands
[NEW] DrawNode supports to draw triangle, quad bezier, cubic bezier.
[FIX] Console: log(format, va_args) is private to prevent possible resolution errors
[FIX] Configuration: dumpInfo() -> getInfo()
[FIX] ControlSlider doesn't support to set selected thumb sprite.
[FIX] ControlButton doesn't support to set scale ratio of touchdown state.

View File

@ -144,24 +144,7 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt)
// Free functions to log
//
// XXX: Deprecated
void CCLog(const char * format, ...)
{
va_list args;
va_start(args, format);
log(format, args);
va_end(args);
}
void log(const char * format, ...)
{
va_list args;
va_start(args, format);
log(format, args);
va_end(args);
}
void log(const char *format, va_list args)
static void _log(const char *format, va_list args)
{
char buf[MAX_LOG_LENGTH];
@ -176,7 +159,7 @@ void log(const char *format, va_list args)
MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf));
OutputDebugStringW(wszBuf);
OutputDebugStringA("\n");
WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE);
printf("%s\n", buf);
@ -189,6 +172,22 @@ void log(const char *format, va_list args)
Director::getInstance()->getConsole()->log(buf);
}
// XXX: Deprecated
void CCLog(const char * format, ...)
{
va_list args;
va_start(args, format);
_log(format, args);
va_end(args);
}
void log(const char * format, ...)
{
va_list args;
va_start(args, format);
_log(format, args);
va_end(args);
}
//
// Console code

View File

@ -58,7 +58,6 @@ static const int MAX_LOG_LENGTH = 16*1024;
@brief Output Debug message.
*/
void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2);
void CC_DLL log(const char * format, va_list args);
/** Console is helper class that lets the developer control the game from TCP connection.
Console will spawn a new thread that will listen to a specified TCP port.

View File

@ -151,7 +151,6 @@ TestController::~TestController()
void TestController::menuCallback(Object * sender)
{
Director::getInstance()->purgeCachedData();
// get the userdata, it's the index of the menu item clicked