diff --git a/include/c11log/details/flush_helper.h b/include/c11log/details/flush_helper.h index b9ed080d..f4827324 100644 --- a/include/c11log/details/flush_helper.h +++ b/include/c11log/details/flush_helper.h @@ -13,7 +13,7 @@ public: _flush_every(flush_every), _write_counter(0) {}; - void write(std::ofstream& ofs, const bufpair_t& msg) + void write(const bufpair_t& msg, std::ofstream& ofs) { ofs.write(msg.first, msg.second); if(++_write_counter == _flush_every) diff --git a/include/c11log/sinks/file_sinks.h b/include/c11log/sinks/file_sinks.h index 94c43577..1d227fb5 100644 --- a/include/c11log/sinks/file_sinks.h +++ b/include/c11log/sinks/file_sinks.h @@ -30,7 +30,7 @@ protected: void _sink_it(const log_msg& msg) override { std::lock_guard lock(_mutex); - _flush_helper.write(_ofstream, msg.msg_buf); + _flush_helper.write(msg.msg_buf, _ofstream); } private: std::mutex _mutex; @@ -70,7 +70,7 @@ protected: _rotate(); _current_size = msg.msg_buf.second; } - _flush_helper.write(_ofstream, msg.msg_buf); + _flush_helper.write(msg.msg_buf, _ofstream); } @@ -143,7 +143,7 @@ protected: _ofstream.open(_calc_filename(_base_filename, _extension)); _midnight_tp = _calc_midnight_tp(); } - _flush_helper.write(_ofstream, msg.msg_buf); + _flush_helper.write(msg.msg_buf, _ofstream); } private: