|
|
@ -214,13 +214,14 @@ void OpenDebugLog() |
|
|
|
assert(vMsgsBeforeOpenLog); |
|
|
|
assert(vMsgsBeforeOpenLog); |
|
|
|
boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; |
|
|
|
boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; |
|
|
|
fileout = fopen(pathDebug.string().c_str(), "a"); |
|
|
|
fileout = fopen(pathDebug.string().c_str(), "a"); |
|
|
|
if (fileout) setbuf(fileout, NULL); // unbuffered
|
|
|
|
if (fileout) { |
|
|
|
|
|
|
|
setbuf(fileout, NULL); // unbuffered
|
|
|
|
// dump buffered messages from before we opened the log
|
|
|
|
// dump buffered messages from before we opened the log
|
|
|
|
while (!vMsgsBeforeOpenLog->empty()) { |
|
|
|
while (!vMsgsBeforeOpenLog->empty()) { |
|
|
|
FileWriteStr(vMsgsBeforeOpenLog->front(), fileout); |
|
|
|
FileWriteStr(vMsgsBeforeOpenLog->front(), fileout); |
|
|
|
vMsgsBeforeOpenLog->pop_front(); |
|
|
|
vMsgsBeforeOpenLog->pop_front(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
delete vMsgsBeforeOpenLog; |
|
|
|
delete vMsgsBeforeOpenLog; |
|
|
|
vMsgsBeforeOpenLog = NULL; |
|
|
|
vMsgsBeforeOpenLog = NULL; |
|
|
|