summaryrefslogtreecommitdiff
path: root/src/common/utils.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-11-15 17:51:29 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-11-15 17:51:29 -0800
commitf906959a09d58c85d87b445fd1791d91bf278bfa (patch)
treeb65282b2c731d4eb2157ae719828cddf6b086943 /src/common/utils.cpp
parent1fb7ce5a604db78c4d02f719053827269705ce13 (diff)
downloadtmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.gz
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.bz2
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.xz
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.zip
Use new IO classes
Diffstat (limited to 'src/common/utils.cpp')
-rw-r--r--src/common/utils.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/utils.cpp b/src/common/utils.cpp
index 383c711..0f8a0af 100644
--- a/src/common/utils.cpp
+++ b/src/common/utils.cpp
@@ -9,6 +9,8 @@
#include "../strings/zstring.hpp"
#include "../strings/xstring.hpp"
+#include "../io/write.hpp"
+
#include "cxxstdio.hpp"
#include "extract.hpp"
@@ -106,18 +108,16 @@ void stamp_time(timestamp_milliseconds_buffer& out)
out = stringish<timestamp_milliseconds_buffer>(const_(buf));
}
-void log_with_timestamp(FILE *out, XString line)
+void log_with_timestamp(io::WriteFile& out, XString line)
{
if (!line)
{
- fputc('\n', out);
+ out.put('\n');
return;
}
timestamp_milliseconds_buffer tmpstr;
stamp_time(tmpstr);
- fputs(tmpstr.c_str(), out);
- fputs(": ", out);
- fwrite(line.data(), 1, line.size(), out);
- if (line.back() != '\n')
- fputc('\n', out);
+ out.really_put(tmpstr.data(), tmpstr.size());
+ out.really_put(": ", 2);
+ out.put_line(line);
}