summaryrefslogtreecommitdiffstats
path: root/src/Log.h
diff options
context:
space:
mode:
authorMatthias P. Braendli (think) <matthias@mpb.li>2012-08-15 17:06:44 +0200
committerMatthias P. Braendli (think) <matthias@mpb.li>2012-08-15 17:06:44 +0200
commit52e36228e7b89de07af15a5029ac2655d5d55dfa (patch)
tree5ac712b32197f9b904fa091b785fa5aeeaea3939 /src/Log.h
parent6603a0b62b22cefbc1ceed00739230e6ccc4a8d9 (diff)
downloaddabmod-52e36228e7b89de07af15a5029ac2655d5d55dfa.tar.gz
dabmod-52e36228e7b89de07af15a5029ac2655d5d55dfa.tar.bz2
dabmod-52e36228e7b89de07af15a5029ac2655d5d55dfa.zip
crc-dabmod: file log corrections
Diffstat (limited to 'src/Log.h')
-rw-r--r--src/Log.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Log.h b/src/Log.h
index dc686fc..617293f 100644
--- a/src/Log.h
+++ b/src/Log.h
@@ -92,7 +92,8 @@ class LogToFile : public LogBackend {
LogToFile(std::string filename) {
name = "FILE";
log_filename = filename;
- log_stream.open(filename.c_str(), std::ios::app);
+
+ log_stream.open(filename.c_str(), std::ios::out | std::ios::app);
if (!log_stream.is_open()) {
throw new std::runtime_error("Cannot open log file !");
}
@@ -113,6 +114,7 @@ class LogToFile : public LogBackend {
va_start(arg_ptr, fmt);
snprintf(message, 200, fmt, arg_ptr);
log_stream << "CRC-DABMOD: " << log_level_text[(size_t)level] << ": " << message << std::endl;
+ log_stream.flush();
va_end(arg_ptr);
}