Using cppformat for all formatting needs instead of fast_oss

This commit is contained in:
gabi
2014-11-29 12:25:37 +02:00
parent 5d399e61d6
commit 8974d2ded9
6 changed files with 69 additions and 413 deletions

View File

@@ -52,7 +52,7 @@ public:
explicit file_helper(bool auto_flush):
_fd(nullptr),
_auto_flush(auto_flush)
{};
{};
file_helper(const file_helper&) = delete;
file_helper& operator=(const file_helper&) = delete;
@@ -99,14 +99,15 @@ public:
void write(const log_msg& msg)
{
auto& buf = msg.formatted.buf();
size_t size = buf.size();
if(std::fwrite(buf.data(), sizeof(char), size, _fd) != size)
size_t size = msg.formatted.size();
auto data = msg.formatted.data();
if(std::fwrite(data, sizeof(char), size, _fd) != size)
throw spdlog_ex("Failed writing to file " + _filename);
if(_auto_flush)
std::fflush(_fd);
}
const std::string& filename() const