Replaced printf(...) and fprintf(stderr, ...) with proper logging.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2356 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/IrixDMIC_RawToJpeg.cxx b/common/rfb/IrixDMIC_RawToJpeg.cxx
index b3378a7..9e2de54 100644
--- a/common/rfb/IrixDMIC_RawToJpeg.cxx
+++ b/common/rfb/IrixDMIC_RawToJpeg.cxx
@@ -4,9 +4,12 @@
 #include <sys/poll.h>
 
 #include <rfb/IrixDMIC_RawToJpeg.h>
+#include <rfb/LogWriter.h>
 
 using namespace rfb;
 
+static LogWriter vlog("IrixDMIC_RawToJpeg");
+
 //
 // Constructor. Find a converter and create a context. Also, create
 // DMparams structures for using with dmICSetSrcParams,
@@ -46,7 +49,7 @@
 
       // FIXME: Just save the engine name and make x0vncserver print it.
       const char *engine = dmParamsGetString(p, DM_IC_ENGINE);
-      printf("Found JPEG encoder: \"%s\" (%d)\n", engine, n);
+      vlog.info("Found JPEG encoder: \"%s\" (%d)", engine, n);
 
       dmParamsDestroy(p);
       break;
@@ -55,7 +58,7 @@
   }
   if (n < 0) {
     // FIXME: Unify error handling.
-    fprintf (stderr, "Error: No matching JPEG encoder found\n");
+    vlog.error("Error: No matching JPEG encoder found");
     return;
   }
   if (dmICCreate(n, &m_ic) != DM_SUCCESS) {
@@ -433,8 +436,8 @@
 {
   char errorDetail[DM_MAX_ERROR_DETAIL];
   const char *errorCategory = dmGetError(NULL, errorDetail);
-  fprintf(stderr, "%s() failed: %s: %s\n",
-	  funcName, errorCategory, errorDetail);
+  vlog.error("%s() failed: %s: %s",
+             funcName, errorCategory, errorDetail);
 }
 
 //
@@ -444,6 +447,6 @@
 void
 IrixDMIC_RawToJpeg::reportErrorNotInited()
 {
-  fprintf(stderr, "Internal error: Image converter not initialized\n");
+  vlog.error("Internal error: Image converter not initialized");
 }