| 202 | } |
| 203 | |
| 204 | void OpenDebugLog() |
| 205 | { |
| 206 | boost::call_once(&DebugPrintInit, debugPrintInitFlag); |
| 207 | boost::mutex::scoped_lock scoped_lock(*mutexDebugLog); |
| 208 | |
| 209 | assert(fileout == NULL); |
| 210 | assert(vMsgsBeforeOpenLog); |
| 211 | boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; |
| 212 | fileout = fopen(pathDebug.string().c_str(), "a"); |
| 213 | if (fileout) setbuf(fileout, NULL); // unbuffered |
| 214 | |
| 215 | // dump buffered messages from before we opened the log |
| 216 | while (!vMsgsBeforeOpenLog->empty()) { |
| 217 | FileWriteStr(vMsgsBeforeOpenLog->front(), fileout); |
| 218 | vMsgsBeforeOpenLog->pop_front(); |
| 219 | } |
| 220 | |
| 221 | delete vMsgsBeforeOpenLog; |
| 222 | vMsgsBeforeOpenLog = NULL; |
| 223 | } |
| 224 | |
| 225 | bool LogAcceptCategory(const char* category) |
| 226 | { |
no test coverage detected