aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-23 11:32:42 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-23 11:32:42 +0100
commitc5f04dce750f2d2301d016de6efca6ec8581e79e (patch)
treecc99d458fac99744766c1c31b957685c88f05d36
parente0abfc3728fb56519fa2507d2468214e2a633c98 (diff)
downloaddabmod-c5f04dce750f2d2301d016de6efca6ec8581e79e.tar.gz
dabmod-c5f04dce750f2d2301d016de6efca6ec8581e79e.tar.bz2
dabmod-c5f04dce750f2d2301d016de6efca6ec8581e79e.zip
Use PRIu64 in Log tracer
-rw-r--r--src/Log.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Log.cpp b/src/Log.cpp
index 3c5b181..4fc7ae3 100644
--- a/src/Log.cpp
+++ b/src/Log.cpp
@@ -27,6 +27,7 @@
#include <list>
#include <cstdarg>
+#include <cinttypes>
#include <chrono>
#include "Log.h"
@@ -173,7 +174,7 @@ LogTracer::LogTracer(const string& trace_filename) : name("TRACE")
m_trace_micros_startup = duration_cast<microseconds>(now).count();
fprintf(m_trace_file.get(),
- "0,TRACER,startup at %ld\n", m_trace_micros_startup);
+ "0,TRACER,startup at %" PRIu64 "\n", m_trace_micros_startup);
}
void LogTracer::log(log_level_t level, const std::string& message)
@@ -183,7 +184,7 @@ void LogTracer::log(log_level_t level, const std::string& message)
const auto now = steady_clock::now().time_since_epoch();
const auto micros = duration_cast<microseconds>(now).count();
- fprintf(m_trace_file.get(), "%ld,%s\n",
+ fprintf(m_trace_file.get(), "%" PRIu64 ",%s\n",
micros - m_trace_micros_startup,
message.c_str());
}