Added _flush() to base_sink

This commit is contained in:
gabime
2017-05-21 03:43:41 +03:00
parent e215758b42
commit 095cb1f560
8 changed files with 46 additions and 32 deletions

View File

@@ -29,14 +29,14 @@ public:
static std::shared_ptr<MyType> instance = std::make_shared<MyType>();
return instance;
}
protected:
void _sink_it(const details::log_msg& msg) override
{
fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stdout);
flush();
}
void flush() override
void _flush() override
{
fflush(stdout);
}
@@ -58,14 +58,14 @@ public:
static std::shared_ptr<MyType> instance = std::make_shared<MyType>();
return instance;
}
protected:
void _sink_it(const details::log_msg& msg) override
{
fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stderr);
flush();
}
void flush() override
void _flush() override
{
fflush(stderr);
}