14 #include <util/pragma_push.def>
16 #pragma warning(disable:4668)
18 #pragma warning(disable : 5039)
25 #include <util/pragma_pop.def>
43 : always_flush(_always_flush), is_a_tty(false), use_SGR(false)
46 HANDLE out_handle=GetStdHandle(STD_OUTPUT_HANDLE);
49 if(GetConsoleMode(out_handle, &consoleMode))
53 #ifdef ENABLE_VIRTUAL_TERMINAL_PROCESSING
54 consoleMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
55 if(SetConsoleMode(out_handle, consoleMode))
87 GetStdHandle((level>1)?STD_OUTPUT_HANDLE:STD_ERROR_HANDLE);
93 if(GetConsoleMode(out_handle, &consoleMode))
101 out_handle, wide_message.c_str(),
102 (DWORD)wide_message.size(), &number_written, NULL);
104 WriteConsoleW(out_handle, L
"\r\n", 2, &number_written, NULL);
138 std::cout << std::flush;
141 std::cerr << std::flush;
bool use_SGR
true if we use ECMA-48 SGR to render colors
bool is_a_tty
true if we are outputting to a proper console
console_message_handlert()
std::string command(unsigned c) const override
Create an ECMA-48 SGR (Select Graphic Rendition) command with given code.
void print(unsigned, const xmlt &) override
virtual void flush(unsigned level) override
virtual void print(unsigned level, const std::string &message)=0
static const char * message(const statust &status)
Makes a status message string from a status.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
std::wstring widen(const char *s)