| 109 | } |
| 110 | |
| 111 | void write(LogDataType type, const QString &msg) { |
| 112 | QMutexLocker lock(_logsMutex(type)); |
| 113 | WritingEntryScope scope; |
| 114 | |
| 115 | if (type != LogDataMain) { |
| 116 | reopenDebug(); |
| 117 | } |
| 118 | const auto file = files[type].get(); |
| 119 | if (!file || !file->isOpen()) { |
| 120 | return; |
| 121 | } |
| 122 | file->write(msg.toUtf8()); |
| 123 | file->flush(); |
| 124 | } |
| 125 | |
| 126 | private: |
| 127 | std::unique_ptr<QFile> files[LogDataCount]; |
no test coverage detected