From 71d8cf20889a3c419c9a3e485f461236e5317423 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 21 May 2014 16:44:06 +0100 Subject: Tidy up logging a bit. Make it configurable from the GUI. --- src/lib/encoder.cc | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/lib/encoder.cc') diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 4fc2d7f81..05da6bbdf 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -39,6 +39,10 @@ #include "i18n.h" +#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); +#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::ERROR); +#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TIMING); + using std::pair; using std::string; using std::stringstream; @@ -78,7 +82,7 @@ Encoder::~Encoder () void Encoder::add_worker_threads (ServerDescription d) { - _film->log()->log (String::compose (N_("Adding %1 worker threads for remote %2"), d.host_name ())); + LOG_GENERAL (N_("Adding %1 worker threads for remote %2"), d.host_name ()); for (int i = 0; i < d.threads(); ++i) { _threads.push_back (new boost::thread (boost::bind (&Encoder::encoder_thread, this, d))); } @@ -100,11 +104,10 @@ Encoder::process_end () { boost::mutex::scoped_lock lock (_mutex); - _film->log()->log (String::compose (N_("Clearing queue of %1"), _queue.size ())); + LOG_GENERAL (N_("Clearing queue of %1"), _queue.size ()); /* Keep waking workers until the queue is empty */ while (!_queue.empty ()) { - _film->log()->log (String::compose (N_("Waking with %1"), _queue.size ()), Log::VERBOSE); _condition.notify_all (); _condition.wait (lock); } @@ -113,7 +116,7 @@ Encoder::process_end () terminate_threads (); - _film->log()->log (String::compose (N_("Mopping up %1"), _queue.size())); + LOG_GENERAL (N_("Mopping up %1"), _queue.size()); /* The following sequence of events can occur in the above code: 1. a remote worker takes the last image off the queue @@ -125,12 +128,12 @@ Encoder::process_end () */ for (list >::iterator i = _queue.begin(); i != _queue.end(); ++i) { - _film->log()->log (String::compose (N_("Encode left-over frame %1"), (*i)->index ())); + LOG_GENERAL (N_("Encode left-over frame %1"), (*i)->index ()); try { _writer->write ((*i)->encode_locally(), (*i)->index (), (*i)->eyes ()); frame_done (); } catch (std::exception& e) { - _film->log()->log (String::compose (N_("Local encode failed (%1)"), e.what ())); + LOG_ERROR (N_("Local encode failed (%1)"), e.what ()); } } @@ -190,9 +193,9 @@ Encoder::process_video (shared_ptr pvf, bool same) /* Wait until the queue has gone down a bit */ while (_queue.size() >= _threads.size() * 2 && !_terminate) { - TIMING ("decoder sleeps with queue of %1", _queue.size()); + LOG_TIMING ("decoder sleeps with queue of %1", _queue.size()); _condition.wait (lock); - TIMING ("decoder wakes with queue of %1", _queue.size()); + LOG_TIMING ("decoder wakes with queue of %1", _queue.size()); } if (_terminate) { @@ -216,7 +219,7 @@ Encoder::process_video (shared_ptr pvf, bool same) frame_done (); } else { /* Queue this new frame for encoding */ - TIMING ("adding to queue of %1", _queue.size ()); + LOG_TIMING ("adding to queue of %1", _queue.size ()); _queue.push_back (shared_ptr ( new DCPVideoFrame ( pvf, _video_frames_out, _film->video_frame_rate(), @@ -270,7 +273,7 @@ try while (1) { - TIMING ("encoder thread %1 sleeps", boost::this_thread::get_id()); + LOG_TIMING ("encoder thread %1 sleeps", boost::this_thread::get_id()); boost::mutex::scoped_lock lock (_mutex); while (_queue.empty () && !_terminate) { _condition.wait (lock); @@ -280,9 +283,9 @@ try return; } - TIMING ("encoder thread %1 wakes with queue of %2", boost::this_thread::get_id(), _queue.size()); + LOG_TIMING ("encoder thread %1 wakes with queue of %2", boost::this_thread::get_id(), _queue.size()); shared_ptr vf = _queue.front (); - TIMING ("encoder thread %1 pops frame %2 (%3) from queue", boost::this_thread::get_id(), vf->index(), vf->eyes ()); + LOG_TIMING ("encoder thread %1 pops frame %2 (%3) from queue", boost::this_thread::get_id(), vf->index(), vf->eyes ()); _queue.pop_front (); lock.unlock (); @@ -294,7 +297,7 @@ try encoded = vf->encode_remotely (server.get ()); if (remote_backoff > 0) { - _film->log()->log (String::compose (N_("%1 was lost, but now she is found; removing backoff"), server->host_name ())); + LOG_GENERAL ("%1 was lost, but now she is found; removing backoff", server->host_name ()); } /* This job succeeded, so remove any backoff */ @@ -305,20 +308,19 @@ try /* back off more */ remote_backoff += 10; } - _film->log()->log ( - String::compose ( - N_("Remote encode of %1 on %2 failed (%3); thread sleeping for %4s"), - vf->index(), server->host_name(), e.what(), remote_backoff) + LOG_ERROR ( + N_("Remote encode of %1 on %2 failed (%3); thread sleeping for %4s"), + vf->index(), server->host_name(), e.what(), remote_backoff ); } } else { try { - TIMING ("encoder thread %1 begins local encode of %2", boost::this_thread::get_id(), vf->index()); + LOG_TIMING ("encoder thread %1 begins local encode of %2", boost::this_thread::get_id(), vf->index()); encoded = vf->encode_locally (); - TIMING ("encoder thread %1 finishes local encode of %2", boost::this_thread::get_id(), vf->index()); + LOG_TIMING ("encoder thread %1 finishes local encode of %2", boost::this_thread::get_id(), vf->index()); } catch (std::exception& e) { - _film->log()->log (String::compose (N_("Local encode failed (%1)"), e.what ())); + LOG_ERROR (N_("Local encode failed (%1)"), e.what ()); } } @@ -327,9 +329,7 @@ try frame_done (); } else { lock.lock (); - _film->log()->log ( - String::compose (N_("Encoder thread %1 pushes frame %2 back onto queue after failure"), boost::this_thread::get_id(), vf->index()) - ); + LOG_GENERAL (N_("Encoder thread %1 pushes frame %2 back onto queue after failure"), boost::this_thread::get_id(), vf->index()); _queue.push_front (vf); lock.unlock (); } -- cgit v1.2.3 From 2935d9d158cf35496a35107f9c4ab7d2929cf6c3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 21 May 2014 22:34:49 +0100 Subject: Try to fix clashes caused by ERROR, WARNING etc. as variables. --- src/lib/config.cc | 4 ++-- src/lib/cross.cc | 4 ++-- src/lib/dcp_video_frame.cc | 2 +- src/lib/encoder.cc | 6 +++--- src/lib/ffmpeg_content.cc | 2 +- src/lib/ffmpeg_decoder.cc | 6 +++--- src/lib/film.cc | 4 ++-- src/lib/image_proxy.cc | 2 +- src/lib/log.cc | 20 ++++++++++---------- src/lib/log.h | 8 ++++---- src/lib/player.cc | 2 +- src/lib/scp_dcp_job.cc | 2 +- src/lib/server.cc | 8 ++++---- src/lib/transcode_job.cc | 4 ++-- src/lib/writer.cc | 6 +++--- src/wx/config_dialog.cc | 16 ++++++++-------- 16 files changed, 48 insertions(+), 48 deletions(-) (limited to 'src/lib/encoder.cc') diff --git a/src/lib/config.cc b/src/lib/config.cc index 6d029dd1f..b97ad559d 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -73,7 +73,7 @@ Config::Config () , _check_for_updates (false) , _check_for_test_updates (false) , _maximum_j2k_bandwidth (250000000) - , _log_types (Log::GENERAL | Log::WARNING | Log::ERROR) + , _log_types (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR) { _allowed_dcp_frame_rates.push_back (24); _allowed_dcp_frame_rates.push_back (25); @@ -191,7 +191,7 @@ Config::read () _maximum_j2k_bandwidth = f.optional_number_child ("MaximumJ2KBandwidth").get_value_or (250000000); _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate"); - _log_types = f.optional_number_child ("LogTypes").get_value_or (Log::GENERAL | Log::WARNING | Log::ERROR); + _log_types = f.optional_number_child ("LogTypes").get_value_or (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR); } void diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 9247baa97..730cfe1d0 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -46,8 +46,8 @@ #include "i18n.h" -#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_ERROR(...) log->log (String::compose (__VA_ARGS__), Log::ERROR); +#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_ERROR(...) log->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); using std::pair; using std::list; diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index 265cbaae8..6cf987648 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -63,7 +63,7 @@ #include "cross.h" #include "player_video_frame.h" -#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), Log::GENERAL); +#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); #include "i18n.h" diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 05da6bbdf..ee43476c9 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -39,9 +39,9 @@ #include "i18n.h" -#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::ERROR); -#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TIMING); +#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); +#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); using std::pair; using std::string; diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 5d0a6a309..41a3724a2 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -34,7 +34,7 @@ extern "C" { #include "i18n.h" -#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); +#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); using std::string; using std::stringstream; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 6351c7e22..5fe34ce14 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -46,9 +46,9 @@ extern "C" { #include "i18n.h" -#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_ERROR(...) film->log()->log (String::compose (__VA_ARGS__), Log::ERROR); -#define LOG_WARNING(...) film->log()->log (__VA_ARGS__, Log::WARNING); +#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_ERROR(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); +#define LOG_WARNING(...) film->log()->log (__VA_ARGS__, Log::TYPE_WARNING); using std::cout; using std::string; diff --git a/src/lib/film.cc b/src/lib/film.cc index 206400da2..5fde0447a 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -81,8 +81,8 @@ using libdcp::Size; using libdcp::Signer; using libdcp::raw_convert; -#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, Log::GENERAL); +#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, Log::TYPE_GENERAL); /* 5 -> 6 * AudioMapping XML changed. diff --git a/src/lib/image_proxy.cc b/src/lib/image_proxy.cc index c0e75c77c..ec5b66555 100644 --- a/src/lib/image_proxy.cc +++ b/src/lib/image_proxy.cc @@ -28,7 +28,7 @@ #include "i18n.h" -#define LOG_TIMING(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::TIMING); +#define LOG_TIMING(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); using std::cout; using std::string; diff --git a/src/lib/log.cc b/src/lib/log.cc index be32315d1..a2f420ce1 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -34,10 +34,10 @@ using namespace std; using boost::algorithm::is_any_of; using boost::algorithm::split; -int const Log::GENERAL = 0x1; -int const Log::WARNING = 0x2; -int const Log::ERROR = 0x4; -int const Log::TIMING = 0x8; +int const Log::TYPE_GENERAL = 0x1; +int const Log::TYPE_WARNING = 0x2; +int const Log::TYPE_ERROR = 0x4; +int const Log::TYPE_TIMING = 0x8; Log::Log () : _types (0) @@ -69,11 +69,11 @@ Log::log (string message, int type) stringstream s; s << a.substr (0, a.length() - 1) << N_(": "); - if (type & ERROR) { + if (type & TYPE_ERROR) { s << "ERROR: "; } - if (type & WARNING) { + if (type & TYPE_WARNING) { s << "WARNING: "; } @@ -118,13 +118,13 @@ Log::set_types (string t) for (vector::const_iterator i = types.begin(); i != types.end(); ++i) { if (*i == N_("general")) { - _types |= GENERAL; + _types |= TYPE_GENERAL; } else if (*i == N_("warning")) { - _types |= WARNING; + _types |= TYPE_WARNING; } else if (*i == N_("error")) { - _types |= ERROR; + _types |= TYPE_ERROR; } else if (*i == N_("timing")) { - _types |= TIMING; + _types |= TYPE_TIMING; } } } diff --git a/src/lib/log.h b/src/lib/log.h index 641ce186d..c11daf617 100644 --- a/src/lib/log.h +++ b/src/lib/log.h @@ -37,10 +37,10 @@ public: Log (); virtual ~Log () {} - static const int GENERAL; - static const int WARNING; - static const int ERROR; - static const int TIMING; + static const int TYPE_GENERAL; + static const int TYPE_WARNING; + static const int TYPE_ERROR; + static const int TYPE_TIMING; void log (std::string message, int type); void microsecond_log (std::string message, int type); diff --git a/src/lib/player.cc b/src/lib/player.cc index a90350922..b112760ef 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -37,7 +37,7 @@ #include "scaler.h" #include "player_video_frame.h" -#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); +#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); using std::list; using std::cout; diff --git a/src/lib/scp_dcp_job.cc b/src/lib/scp_dcp_job.cc index 30bfc3441..637840813 100644 --- a/src/lib/scp_dcp_job.cc +++ b/src/lib/scp_dcp_job.cc @@ -37,7 +37,7 @@ #include "i18n.h" -#define LOG_GENERAL_NC(...) _film->log()->microsecond_log (__VA_ARGS__, Log::GENERAL); +#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL); using std::string; using std::stringstream; diff --git a/src/lib/server.cc b/src/lib/server.cc index c4c98a4c9..6b4064cd7 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -41,10 +41,10 @@ #include "i18n.h" -#define LOG_GENERAL(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_GENERAL_NC(...) _log->microsecond_log (__VA_ARGS__, Log::GENERAL); -#define LOG_ERROR(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::ERROR); -#define LOG_ERROR_NC(...) _log->microsecond_log (__VA_ARGS__, Log::ERROR); +#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_GENERAL_NC(...) _log->log (__VA_ARGS__, Log::TYPE_GENERAL); +#define LOG_ERROR(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); +#define LOG_ERROR_NC(...) _log->log (__VA_ARGS__, Log::TYPE_ERROR); using std::string; using std::stringstream; diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index fb9a59179..ef15f9f5e 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -30,8 +30,8 @@ #include "i18n.h" -#define LOG_GENERAL_NC(...) _film->log()->microsecond_log (__VA_ARGS__, Log::GENERAL); -#define LOG_ERROR_NC(...) _film->log()->microsecond_log (__VA_ARGS__, Log::ERROR); +#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL); +#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_ERROR); using std::string; using std::stringstream; diff --git a/src/lib/writer.cc b/src/lib/writer.cc index b058c2801..b175843ed 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -40,9 +40,9 @@ #include "i18n.h" -#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TIMING); -#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::WARNING); +#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); +#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_WARNING); /* OS X strikes again */ #undef set_key diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 109ff9f87..684d2496e 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -764,13 +764,13 @@ public: _maximum_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&AdvancedPage::maximum_j2k_bandwidth_changed, this)); _allow_any_dcp_frame_rate->SetValue (config->allow_any_dcp_frame_rate ()); _allow_any_dcp_frame_rate->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::allow_any_dcp_frame_rate_changed, this)); - _log_general->SetValue (config->log_types() & Log::GENERAL); + _log_general->SetValue (config->log_types() & Log::TYPE_GENERAL); _log_general->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); - _log_warning->SetValue (config->log_types() & Log::WARNING); + _log_warning->SetValue (config->log_types() & Log::TYPE_WARNING); _log_warning->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); - _log_error->SetValue (config->log_types() & Log::ERROR); + _log_error->SetValue (config->log_types() & Log::TYPE_ERROR); _log_error->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); - _log_timing->SetValue (config->log_types() & Log::TIMING); + _log_timing->SetValue (config->log_types() & Log::TYPE_TIMING); _log_timing->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); return panel; @@ -792,16 +792,16 @@ private: { int types = 0; if (_log_general->GetValue ()) { - types |= Log::GENERAL; + types |= Log::TYPE_GENERAL; } if (_log_warning->GetValue ()) { - types |= Log::WARNING; + types |= Log::TYPE_WARNING; } if (_log_error->GetValue ()) { - types |= Log::ERROR; + types |= Log::TYPE_ERROR; } if (_log_timing->GetValue ()) { - types |= Log::TIMING; + types |= Log::TYPE_TIMING; } Config::instance()->set_log_types (types); } -- cgit v1.2.3 From 8327abf0e5bec38f12f16dab1d5c7b609baf3db0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 May 2014 22:45:06 +0100 Subject: Tweak logging a bit. --- src/lib/encoder.cc | 14 +++++++------- src/lib/image_proxy.cc | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib/encoder.cc') diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index ee43476c9..e83ac70f5 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -41,7 +41,7 @@ #define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); #define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); -#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); +#define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); using std::pair; using std::string; @@ -273,7 +273,7 @@ try while (1) { - LOG_TIMING ("encoder thread %1 sleeps", boost::this_thread::get_id()); + LOG_TIMING ("[%1] encoder thread sleeps", boost::this_thread::get_id()); boost::mutex::scoped_lock lock (_mutex); while (_queue.empty () && !_terminate) { _condition.wait (lock); @@ -283,9 +283,9 @@ try return; } - LOG_TIMING ("encoder thread %1 wakes with queue of %2", boost::this_thread::get_id(), _queue.size()); + LOG_TIMING ("[%1] encoder thread wakes with queue of %2", boost::this_thread::get_id(), _queue.size()); shared_ptr vf = _queue.front (); - LOG_TIMING ("encoder thread %1 pops frame %2 (%3) from queue", boost::this_thread::get_id(), vf->index(), vf->eyes ()); + LOG_TIMING ("[%1] encoder thread pops frame %2 (%3) from queue", boost::this_thread::get_id(), vf->index(), vf->eyes ()); _queue.pop_front (); lock.unlock (); @@ -316,9 +316,9 @@ try } else { try { - LOG_TIMING ("encoder thread %1 begins local encode of %2", boost::this_thread::get_id(), vf->index()); + LOG_TIMING ("[%1] encoder thread begins local encode of %2", boost::this_thread::get_id(), vf->index()); encoded = vf->encode_locally (); - LOG_TIMING ("encoder thread %1 finishes local encode of %2", boost::this_thread::get_id(), vf->index()); + LOG_TIMING ("[%1] encoder thread finishes local encode of %2", boost::this_thread::get_id(), vf->index()); } catch (std::exception& e) { LOG_ERROR (N_("Local encode failed (%1)"), e.what ()); } @@ -329,7 +329,7 @@ try frame_done (); } else { lock.lock (); - LOG_GENERAL (N_("Encoder thread %1 pushes frame %2 back onto queue after failure"), boost::this_thread::get_id(), vf->index()); + LOG_GENERAL (N_("[%1] Encoder thread pushes frame %2 back onto queue after failure"), boost::this_thread::get_id(), vf->index()); _queue.push_front (vf); lock.unlock (); } diff --git a/src/lib/image_proxy.cc b/src/lib/image_proxy.cc index ec5b66555..ced597fff 100644 --- a/src/lib/image_proxy.cc +++ b/src/lib/image_proxy.cc @@ -118,7 +118,7 @@ MagickImageProxy::image () const return _image; } - LOG_TIMING ("MagickImageProxy begins read and decode of %1 bytes", _blob.length()); + LOG_TIMING ("[%1] MagickImageProxy begins read and decode of %2 bytes", boost::this_thread::get_id(), _blob.length()); Magick::Image* magick_image = 0; try { @@ -147,7 +147,7 @@ MagickImageProxy::image () const delete magick_image; - LOG_TIMING ("MagickImageProxy completes read and decode of %1 bytes", _blob.length()); + LOG_TIMING ("[%1] MagickImageProxy completes read and decode of %1 bytes", boost::this_thread::get_id(), _blob.length()); return _image; } -- cgit v1.2.3