mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 03:09:49 +02:00
added more debugging for error conditions
This commit is contained in:
@@ -47,8 +47,6 @@
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
|
||||
|
||||
#include "leak_dumper.h"
|
||||
|
||||
using namespace Shared::Platform;
|
||||
|
@@ -84,7 +84,7 @@ void SystemFlags::Close() {
|
||||
currentDebugLog.fileStream->close();
|
||||
}
|
||||
delete currentDebugLog.fileStream;
|
||||
delete currentDebugLog.mutex;
|
||||
//delete currentDebugLog.mutex;
|
||||
}
|
||||
currentDebugLog.fileStream = NULL;
|
||||
currentDebugLog.fileStreamOwner = false;
|
||||
@@ -143,7 +143,7 @@ void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
currentDebugLog2.fileStream != NULL) {
|
||||
currentDebugLog.fileStream = currentDebugLog2.fileStream;
|
||||
currentDebugLog.fileStreamOwner = false;
|
||||
currentDebugLog.mutex = currentDebugLog2.mutex;
|
||||
//currentDebugLog.mutex = currentDebugLog2.mutex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -189,17 +189,17 @@ void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
currentDebugLog.fileStream = new std::ofstream();
|
||||
currentDebugLog.fileStream->open(debugLog.c_str(), ios_base::out | ios_base::trunc);
|
||||
currentDebugLog.fileStreamOwner = true;
|
||||
currentDebugLog.mutex = new Mutex();
|
||||
//currentDebugLog.mutex = new Mutex();
|
||||
}
|
||||
|
||||
printf("Opening logfile [%s] type = %d, currentDebugLog.fileStreamOwner = %d\n",debugLog.c_str(),type, currentDebugLog.fileStreamOwner);
|
||||
|
||||
currentDebugLog.mutex->p();
|
||||
//currentDebugLog.mutex->p();
|
||||
|
||||
(*currentDebugLog.fileStream) << "Starting Mega-Glest logging for type: " << type << "\n";
|
||||
(*currentDebugLog.fileStream).flush();
|
||||
|
||||
currentDebugLog.mutex->v();
|
||||
//currentDebugLog.mutex->v();
|
||||
}
|
||||
|
||||
//printf("Logfile is open [%s]\n",SystemFlags::debugLogFile);
|
||||
@@ -208,12 +208,12 @@ void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
|
||||
assert(currentDebugLog.fileStream != NULL);
|
||||
|
||||
currentDebugLog.mutex->p();
|
||||
//currentDebugLog.mutex->p();
|
||||
|
||||
(*currentDebugLog.fileStream) << "[" << szBuf2 << "] " << szBuf;
|
||||
(*currentDebugLog.fileStream).flush();
|
||||
|
||||
currentDebugLog.mutex->v();
|
||||
//currentDebugLog.mutex->v();
|
||||
}
|
||||
// output to console
|
||||
else {
|
||||
|
Reference in New Issue
Block a user