fixed flush

This commit is contained in:
gabime 2017-05-21 02:25:33 +03:00
parent 8c240faa7d
commit 1f9f9c09a2

View File

@ -35,7 +35,7 @@ public:
colors_[level::warn] = "\033[33m\033[1m"; // yellow_bold; colors_[level::warn] = "\033[33m\033[1m"; // yellow_bold;
colors_[level::err] = "\033[31m\033[1m"; // red_bold; colors_[level::err] = "\033[31m\033[1m"; // red_bold;
colors_[level::critical] = "\033[1m\033[41m"; // bold_red_bg; colors_[level::critical] = "\033[1m\033[41m"; // bold_red_bg;
colors_[level::off] = "\033[00m"; //reset; colors_[level::off] = "\033[0m"; //reset;
} }
virtual ~ansicolor_sink() virtual ~ansicolor_sink()
{ {
@ -64,6 +64,7 @@ protected:
{ {
fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), target_file_); fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), target_file_);
} }
flush();
} }
FILE* target_file_; FILE* target_file_;
bool should_do_colors_; bool should_do_colors_;