- more tweaking of threaded logging as well as removal of world synch logging items that are not needed

This commit is contained in:
Mark Vejvoda
2010-12-26 01:13:04 +00:00
parent 36f62ea084
commit 409c15d3f0
2 changed files with 27 additions and 2 deletions

View File

@@ -1715,7 +1715,28 @@ void Unit::exploreCells() {
void Unit::logSynchData(string file,int line,string source) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
char szBuf[1024]="";
char szBuf[4096]="";
sprintf(szBuf,
"FrameCount [%d] Unit = %d [%s][%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, progress [%f], progress2 [%d]\nUnit Path [%s]\n",
getFrameCount(),
id,
getFullName().c_str(),
faction->getType()->getName().c_str(),
//getDesc().c_str(),
pos.getString().c_str(),
lastPos.getString().c_str(),
targetPos.getString().c_str(),
targetVec.getString().c_str(),
meetingPos.getString().c_str(),
// lastRotation,
// targetRotation,
// rotation,
progress,
progress2,
(unitPath != NULL ? unitPath->toString().c_str() : "NULL"));
/*
sprintf(szBuf,
"FrameCount [%d] Unit = %d [%s][%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, lastRotation [%f], targetRotation [%f], rotation [%f], progress [%f], progress2 [%d]\nUnit Path [%s]\n",
getFrameCount(),
@@ -1734,7 +1755,7 @@ void Unit::logSynchData(string file,int line,string source) {
progress,
progress2,
(unitPath != NULL ? unitPath->toString().c_str() : "NULL"));
*/
if( lastSynchDataString != string(szBuf) ||
lastFile != file ||
lastLine != line ||

View File

@@ -206,6 +206,10 @@ void LogFileThread::addLogEntry(SystemFlags::DebugType type, string logEntry) {
entry.entry = logEntry;
entry.entryDateTime = time(NULL);
logList.push_back(entry);
if(logList.size() >= 100000) {
saveToDisk(false);
}
}
bool LogFileThread::checkSaveCurrentLogBufferToDisk() {