moved to log_msg

This commit is contained in:
gabime
2014-03-28 16:05:09 +03:00
parent 0b2bd0fc73
commit f909caf38b
11 changed files with 118 additions and 87 deletions

View File

@@ -27,10 +27,10 @@ public:
{
}
protected:
void _sink_it(const bufpair_t& msg) override
void _sink_it(const log_msg& msg) override
{
std::lock_guard<std::mutex> lock(_mutex);
_flush_helper.write(_ofstream, msg);
_flush_helper.write(_ofstream, msg.msg_buf);
}
private:
std::mutex _mutex;
@@ -60,16 +60,17 @@ public:
}
protected:
void _sink_it(const bufpair_t& msg) override
void _sink_it(const log_msg& msg) override
{
std::lock_guard<std::mutex> lock(_mutex);
_current_size += msg.second;
_current_size += msg.msg_buf.second;
if (_current_size > _max_size)
{
_rotate();
_current_size = msg.second;
_current_size = msg.msg_buf.second;
}
_flush_helper.write(_ofstream, msg);
_flush_helper.write(_ofstream, msg.msg_buf);
}
@@ -133,7 +134,7 @@ public:
}
protected:
void _sink_it(const bufpair_t& msg) override
void _sink_it(const log_msg& msg) override
{
std::lock_guard<std::mutex> lock(_mutex);
if (std::chrono::system_clock::now() >= _midnight_tp)
@@ -142,7 +143,7 @@ protected:
_ofstream.open(_calc_filename(_base_filename, _extension));
_midnight_tp = _calc_midnight_tp();
}
_flush_helper.write(_ofstream, msg);
_flush_helper.write(_ofstream, msg.msg_buf);
}
private: