X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fencoded_log_entry.cc;h=4e1b98210b24ded346b8428c298c5be6f7a52c3b;hb=3799e91d126d243d41c44dcb0ca1bfa66b53a57e;hp=84c7a6ca6ba61e252bc731173988ae20b885573b;hpb=422be0eece2bf6ee80db1d3c21553cd82efff789;p=dcpomatic.git diff --git a/src/lib/encoded_log_entry.cc b/src/lib/encoded_log_entry.cc index 84c7a6ca6..4e1b98210 100644 --- a/src/lib/encoded_log_entry.cc +++ b/src/lib/encoded_log_entry.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2015 Carl Hetherington + Copyright (C) 2015-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,11 +18,13 @@ */ + #include "encoded_log_entry.h" -#include +#include + using std::string; -using std::fixed; + EncodedLogEntry::EncodedLogEntry (int frame, string ip, double receive, double encode, double send) : LogEntry (LogEntry::TYPE_GENERAL) @@ -35,16 +37,11 @@ EncodedLogEntry::EncodedLogEntry (int frame, string ip, double receive, double e } + string EncodedLogEntry::message () const { - locked_stringstream m; - m.precision (2); - m << fixed - << "Encoded frame " << _frame << " from " << _ip << ": " - << "receive " << _receive << "s " - << "encode " << _encode << "s " - << "send " << _send << "s."; - - return m.str (); + char buffer[256]; + snprintf (buffer, sizeof(buffer), "Encoded frame %d from %s: receive %.2fs encode %.2fs send %.2fs.", _frame, _ip.c_str(), _receive, _encode, _send); + return buffer; }