- added code to now output all eerors to console (with option to save in log file)

- added more LUA debug info
This commit is contained in:
Mark Vejvoda
2010-10-06 20:22:06 +00:00
parent 268aa4793b
commit 0d050f62d4
36 changed files with 185 additions and 60 deletions

View File

@@ -151,12 +151,13 @@ CURL *SystemFlags::initHTTP() {
void SystemFlags::init(bool haveSpecialOutputCommandLineOption) {
SystemFlags::haveSpecialOutputCommandLineOption = haveSpecialOutputCommandLineOption;
if(SystemFlags::debugLogFileList.size() == 0) {
SystemFlags::debugLogFileList[SystemFlags::debugSystem] = SystemFlags::SystemFlagsType(SystemFlags::debugSystem);
SystemFlags::debugLogFileList[SystemFlags::debugNetwork] = SystemFlags::SystemFlagsType(SystemFlags::debugNetwork);
SystemFlags::debugLogFileList[SystemFlags::debugPerformance] = SystemFlags::SystemFlagsType(SystemFlags::debugPerformance);
SystemFlags::debugLogFileList[SystemFlags::debugWorldSynch] = SystemFlags::SystemFlagsType(SystemFlags::debugWorldSynch);
SystemFlags::debugLogFileList[SystemFlags::debugUnitCommands] = SystemFlags::SystemFlagsType(SystemFlags::debugUnitCommands);
SystemFlags::debugLogFileList[SystemFlags::debugLUA] = SystemFlags::SystemFlagsType(SystemFlags::debugLUA);
SystemFlags::debugLogFileList[SystemFlags::debugSystem] = SystemFlags::SystemFlagsType(SystemFlags::debugSystem);
SystemFlags::debugLogFileList[SystemFlags::debugNetwork] = SystemFlags::SystemFlagsType(SystemFlags::debugNetwork);
SystemFlags::debugLogFileList[SystemFlags::debugPerformance] = SystemFlags::SystemFlagsType(SystemFlags::debugPerformance);
SystemFlags::debugLogFileList[SystemFlags::debugWorldSynch] = SystemFlags::SystemFlagsType(SystemFlags::debugWorldSynch);
SystemFlags::debugLogFileList[SystemFlags::debugUnitCommands] = SystemFlags::SystemFlagsType(SystemFlags::debugUnitCommands);
SystemFlags::debugLogFileList[SystemFlags::debugLUA] = SystemFlags::SystemFlagsType(SystemFlags::debugLUA);
SystemFlags::debugLogFileList[SystemFlags::debugError] = SystemFlags::SystemFlagsType(SystemFlags::debugError);
}
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
@@ -360,9 +361,12 @@ void SystemFlags::handleDebug(DebugType type, const char *fmt, ...) {
MutexSafeWrapper safeMutex(currentDebugLog.mutex);
if (type != debugPathFinder) {
if (type != debugPathFinder && type != debugError) {
(*currentDebugLog.fileStream) << "[" << szBuf2 << "] " << szBuf;
}
else if (type == debugError) {
(*currentDebugLog.fileStream) << "[" << szBuf2 << "] *ERROR* " << szBuf;
}
else {
(*currentDebugLog.fileStream) << szBuf;
}
@@ -372,9 +376,12 @@ void SystemFlags::handleDebug(DebugType type, const char *fmt, ...) {
}
// output to console
else {
if (type != debugPathFinder) {
if (type != debugPathFinder && type != debugError) {
printf("[%s] %s", szBuf2, szBuf);
}
else if (type == debugError) {
printf("[%s] *ERROR* %s", szBuf2, szBuf);
}
else {
printf("%s", szBuf);
}