Tweak logging a bit.
authorCarl Hetherington <cth@carlh.net>
Fri, 23 May 2014 21:45:06 +0000 (22:45 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 23 May 2014 21:45:06 +0000 (22:45 +0100)
src/lib/encoder.cc
src/lib/image_proxy.cc

index ee43476c95153c3d6ed3295f6eb7c04a8fe96a12..e83ac70f52a379cef6688f00e0c72a284544abf5 100644 (file)
@@ -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<DCPVideoFrame> 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 ();
                }
index ec5b6655521a10a20ac46c12793772d1954f976d..ced597fffe1d162ac335f63f49d46673f5889566 100644 (file)
@@ -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;
 }