diff OrthancServer/Internals/StoreScp.cpp @ 102:7593b57dc1bf

switch to google log
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 Oct 2012 16:28:13 +0200
parents 428784e59dcd
children f2ecbe7d50b8
line wrap: on
line diff
--- a/OrthancServer/Internals/StoreScp.cpp	Wed Oct 03 11:44:46 2012 +0200
+++ b/OrthancServer/Internals/StoreScp.cpp	Wed Oct 03 16:28:13 2012 +0200
@@ -23,13 +23,13 @@
 #include "../FromDcmtkBridge.h"
 #include "../ToDcmtkBridge.h"
 #include "../../Core/OrthancException.h"
-#include "DcmtkLogging.h"
 
 #include <dcmtk/dcmdata/dcfilefo.h>
 #include <dcmtk/dcmdata/dcmetinf.h>
 #include <dcmtk/dcmdata/dcostrmb.h>
 #include <dcmtk/dcmdata/dcdeftag.h>
 #include <dcmtk/dcmnet/diutil.h>
+#include <glog/logging.h>
 
 
 namespace Orthanc
@@ -64,12 +64,13 @@
 
       dataSet->transferInit();
 
-#if 0
+#if 1
       OFCondition c = dataSet->write(ob, xfer, encodingType, NULL,
                                      /*opt_groupLength*/ EGL_recalcGL,
                                      /*opt_paddingType*/ EPD_withoutPadding);
+#else
+      OFCondition c = dataSet->write(ob, xfer, encodingType);
 #endif
-      OFCondition c = dataSet->write(ob, xfer, encodingType);
 
       dataSet->transferEnd();
       if (c.good())
@@ -155,7 +156,7 @@
 
             if (SaveToMemoryBuffer(*imageDataSet, buffer) < 0)
             {
-              LOG4CPP_ERROR(Internals::GetLogger(), "cannot write DICOM file to memory");
+              LOG(ERROR) << "cannot write DICOM file to memory";
               rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources;
             }
           }
@@ -191,7 +192,7 @@
               catch (OrthancException& e)
               {
                 rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources;
-                LOG4CPP_ERROR(Internals::GetLogger(), "Exception while storing DICOM: " + std::string(e.What()));
+                LOG(ERROR) << "Exception while storing DICOM: " << e.What();
               }
             }
           }
@@ -260,7 +261,7 @@
     if (cond.bad())
     {
       OFString temp_str;
-      LOG4CPP_ERROR(GetLogger(), "Store SCP Failed: " + std::string(cond.text()));
+      LOG(ERROR) << "Store SCP Failed: " << cond.text();
     }
 
     // return return value