|
|
|
@ -13,6 +13,7 @@
|
|
|
|
|
#include <vector>
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#include <share.h> // For _SH_DENYWR
|
|
|
|
|
#include <windows.h> // For OutputDebugStringA
|
|
|
|
|
#else
|
|
|
|
|
#define _SH_DENYWR 0
|
|
|
|
|
#endif
|
|
|
|
@ -139,12 +140,18 @@ void FileBackend::Write(const Entry& entry) {
|
|
|
|
|
if (!file.IsOpen() || bytes_written > MAX_BYTES_WRITTEN) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
bytes_written += file.WriteString(FormatLogMessage(entry) + '\n');
|
|
|
|
|
bytes_written += file.WriteString(FormatLogMessage(entry).append(1, '\n'));
|
|
|
|
|
if (entry.log_level >= Level::Error) {
|
|
|
|
|
file.Flush();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DebuggerBackend::Write(const Entry& entry) {
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
::OutputDebugStringA(FormatLogMessage(entry).append(1, '\n').c_str());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Macro listing all log classes. Code should define CLS and SUB as desired before invoking this.
|
|
|
|
|
#define ALL_LOG_CLASSES() \
|
|
|
|
|
CLS(Log) \
|
|
|
|
|