From c5f04dce750f2d2301d016de6efca6ec8581e79e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 23 Jan 2019 11:32:42 +0100 Subject: Use PRIu64 in Log tracer --- src/Log.cpp | 5 +++-- 1 file 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 #include +#include #include #include "Log.h" @@ -173,7 +174,7 @@ LogTracer::LogTracer(const string& trace_filename) : name("TRACE") m_trace_micros_startup = duration_cast(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(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()); } -- cgit v1.2.3