mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
flush_help small change
This commit is contained in:
parent
f909caf38b
commit
88ff314416
@ -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)
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
void _sink_it(const log_msg& msg) override
|
||||
{
|
||||
std::lock_guard<std::mutex> 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:
|
||||
|
Loading…
Reference in New Issue
Block a user