mirror of
https://github.com/u0u0/Quick-Cocos2dx-Community.git
synced 2026-06-25 08:27:14 +08:00
add: command line param -multi-log-files.
This commit is contained in:
@@ -25,6 +25,7 @@ ProjectConfig::ProjectConfig()
|
||||
, _showConsole(true)
|
||||
, _loadPrecompiledFramework(false)
|
||||
, _writeDebugLogToFile(true)
|
||||
, _isMultiLogFiles(false)
|
||||
, _windowOffset(0, 0)
|
||||
, _debuggerType(kCCLuaDebuggerNone)
|
||||
, _isAppMenu(true)
|
||||
@@ -270,11 +271,14 @@ void ProjectConfig::setWriteDebugLogToFile(bool writeDebugLogToFile)
|
||||
string ProjectConfig::getDebugLogFilePath() const
|
||||
{
|
||||
auto path(getProjectDir());
|
||||
time_t t = time(0);
|
||||
char tmp[64];
|
||||
strftime(tmp, sizeof(tmp), "_%Y%m%d_%H%M%S", localtime(&t));
|
||||
path.append("debug");
|
||||
path.append(tmp);
|
||||
if (_isMultiLogFiles)
|
||||
{
|
||||
time_t t = time(0);
|
||||
char tmp[64] = {};
|
||||
strftime(tmp, sizeof(tmp), "_%Y%m%d_%H%M%S", localtime(&t));
|
||||
path.append(tmp);
|
||||
}
|
||||
path.append(".log");
|
||||
return path;
|
||||
}
|
||||
@@ -378,6 +382,10 @@ void ProjectConfig::parseCommandLine(const vector<string> &args)
|
||||
{
|
||||
setWriteDebugLogToFile(false);
|
||||
}
|
||||
else if (arg.compare("-multi-log-files") == 0)
|
||||
{
|
||||
_isMultiLogFiles = true;
|
||||
}
|
||||
else if (arg.compare("-console") == 0)
|
||||
{
|
||||
setShowConsole(true);
|
||||
@@ -587,6 +595,7 @@ void ProjectConfig::dump()
|
||||
CCLOG(" frame scale: %0.2f", _frameScale);
|
||||
CCLOG(" show console: %s", _showConsole ? "YES" : "NO");
|
||||
CCLOG(" write debug log: %s", _writeDebugLogToFile ? "YES" : "NO");
|
||||
CCLOG(" create multi log files: %s", _isMultiLogFiles ? "YES" : "NO");
|
||||
CCLOG(" debugger: none");
|
||||
CCLOG("\n\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user