nice logger api improvement

This commit is contained in:
gabime
2014-03-31 02:09:13 +03:00
parent ff824cdb5a
commit 9e1ba5167a
3 changed files with 54 additions and 36 deletions

View File

@@ -58,17 +58,25 @@ public:
}
}
template<typename T>
line_logger& operator<<(const T& what)
template<typename T>
void write(const T& what)
{
if (_enabled)
{
_oss << what;
_empty = false;
}
}
template<typename T>
line_logger& operator<<(const T& what)
{
write(what);
return *this;
}
private:
logger* _callback_logger;
log_msg _log_msg;