changeset 541:b336dfa71f12 dev

logs
author Alain Mazy <alain@mazy.be>
date Wed, 20 Mar 2019 10:11:53 +0100
parents d785ee57bd95
children 75664eeacae5
files Applications/Generic/NativeStoneApplicationRunner.cpp Framework/Radiography/RadiographyScene.cpp
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Generic/NativeStoneApplicationRunner.cpp	Tue Mar 19 14:43:46 2019 +0100
+++ b/Applications/Generic/NativeStoneApplicationRunner.cpp	Wed Mar 20 10:11:53 2019 +0100
@@ -141,6 +141,13 @@
     if (parameters.count("verbose"))
     {
       Orthanc::Logging::EnableInfoLevel(true);
+      LOG(INFO) << "Verbose logs are enabled";
+    }
+
+    if (parameters.count("trace"))
+    {
+      Orthanc::Logging::EnableTraceLevel(true);
+      VLOG(1) << "Trace logs are enabled";
     }
 
     ParseCommandLineOptions(parameters);
--- a/Framework/Radiography/RadiographyScene.cpp	Tue Mar 19 14:43:46 2019 +0100
+++ b/Framework/Radiography/RadiographyScene.cpp	Wed Mar 20 10:11:53 2019 +0100
@@ -558,8 +558,6 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
     }
 
-    LOG(INFO) << "Exporting DICOM";
-
     Extent2D extent = GetSceneExtent();
 
     int w = static_cast<int>(std::ceil(extent.GetWidth() / pixelSpacingX));
@@ -603,6 +601,9 @@
                                                     ImageInterpolation interpolation,
                                                     bool usePam)
   {
+    LOG(INFO) << "Exporting RadiographyScene to DICOM";
+    VLOG(1) << "Exporting RadiographyScene to: export to image";
+
     std::auto_ptr<Orthanc::Image> rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags
 
     std::string base64;
@@ -612,6 +613,7 @@
 
       if (usePam)
       {
+        VLOG(1) << "Exporting RadiographyScene: convert to PAM";
         Orthanc::PamWriter writer;
         writer.WriteToMemory(content, *rendered);
       }
@@ -621,6 +623,7 @@
         writer.WriteToMemory(content, *rendered);
       }
 
+      VLOG(1) << "Exporting RadiographyScene: encoding to base64";
       Orthanc::Toolbox::EncodeBase64(base64, content);
     }
 
@@ -667,6 +670,7 @@
       createDicomRequestContent["Parent"] = parentOrthancId;
     }
 
+    VLOG(1) << "Exporting RadiographyScene: create-dicom request is ready";
   }