---------------------------------------------------------------------------------- Will attach a new stream
| 313 | // ---------------------------------------------------------------------------------- |
| 314 | // Will attach a new stream |
| 315 | bool DefaultLogger::attachStream(LogStream *pStream, unsigned int severity) { |
| 316 | if (nullptr == pStream) { |
| 317 | return false; |
| 318 | } |
| 319 | |
| 320 | if (0 == severity) { |
| 321 | severity = SeverityAll; |
| 322 | } |
| 323 | |
| 324 | #ifndef ASSIMP_BUILD_SINGLETHREADED |
| 325 | std::lock_guard<std::mutex> lock(m_arrayMutex); |
| 326 | #endif |
| 327 | |
| 328 | for (StreamIt it = m_StreamArray.begin(); |
| 329 | it != m_StreamArray.end(); |
| 330 | ++it) { |
| 331 | if ((*it)->m_pStream == pStream) { |
| 332 | (*it)->m_uiErrorSeverity |= severity; |
| 333 | return true; |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | m_StreamArray.push_back(new LogStreamInfo(severity, pStream)); |
| 338 | |
| 339 | return true; |
| 340 | } |
| 341 | |
| 342 | // ---------------------------------------------------------------------------------- |
| 343 | // Detach a stream |