CppLogging  1.0.4.0
C++ Logging Library
debug_appender.cpp
Go to the documentation of this file.
1 
10 
11 #if defined(_WIN32) || defined(_WIN64)
12 #include <windows.h>
13 #else
14 #include <cstdio>
15 #endif
16 
17 namespace CppLogging {
18 
20 {
21  // Skip logging records without layout
22  if (record.raw.empty())
23  return;
24 
25 #if defined(_WIN32) || defined(_WIN64)
26  // Append logging record content
27  OutputDebugStringA((LPCSTR)record.raw.data());
28 #else
29  // Append logging record content
30  std::fwrite(record.raw.data(), 1, record.raw.size() - 1, stdout);
31 #endif
32 }
33 
35 {
36 #if defined(_WIN32) || defined(_WIN64)
37  // Do nothing here...
38 #else
39  // Flush stream
40  std::fflush(stdout);
41 #endif
42 }
43 
44 } // namespace CppLogging
void Flush() override
Flush the logging appender.
void AppendRecord(Record &record) override
Append the given logging record.
Logging record.
Definition: record.h:37
std::vector< uint8_t > raw
Record content after layout.
Definition: record.h:53
Debug appender definition.
C++ Logging project definitions.
Definition: appender.h:15