| 83 | template<typename Mutex> |
| 84 | template<typename T> |
| 85 | void lazy_file_sink<Mutex>::write(const T &thing) |
| 86 | { |
| 87 | DWORD bytesWritten; |
| 88 | if (WriteFile(m_Handle.get(), thing.data(), wil::safe_cast<DWORD>(thing.size()), &bytesWritten, nullptr)) |
| 89 | { |
| 90 | if (bytesWritten != thing.size()) [[unlikely]] |
| 91 | { |
| 92 | MessagePrint(spdlog::level::trace, L"Wrote less characters than there is in log entry?"); |
| 93 | } |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | LastErrorHandle(spdlog::level::trace, L"Failed to write log entry to file."); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // We don't actually use the singlethreaded sink. |
| 102 | template class lazy_file_sink<std::mutex>; |