changeset 4272:1661544ea94d

LogCategory_REST
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Nov 2020 07:19:33 +0100
parents 1bd14c900699
children 0034f855c023
files OrthancFramework/Sources/Logging.cpp OrthancFramework/Sources/Logging.h OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp
diffstat 5 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Logging.cpp	Tue Nov 03 07:15:44 2020 +0100
+++ b/OrthancFramework/Sources/Logging.cpp	Tue Nov 03 07:19:33 2020 +0100
@@ -203,6 +203,10 @@
       {
         return LogCategory_PLUGINS;
       }
+      else if (category == "rest")
+      {
+        return LogCategory_REST;
+      }
       else if (category == "dicom")
       {
         return LogCategory_DICOM;
--- a/OrthancFramework/Sources/Logging.h	Tue Nov 03 07:15:44 2020 +0100
+++ b/OrthancFramework/Sources/Logging.h	Tue Nov 03 07:19:33 2020 +0100
@@ -62,8 +62,9 @@
     {
       LogCategory_GENERIC = (1 << 0),
       LogCategory_PLUGINS = (1 << 1),
-      LogCategory_SQLITE  = (1 << 2),
-      LogCategory_DICOM   = (1 << 3)
+      LogCategory_REST    = (1 << 2),
+      LogCategory_SQLITE  = (1 << 3),
+      LogCategory_DICOM   = (1 << 4)
     };
     
     ORTHANC_PUBLIC const char* EnumerationToString(LogLevel level);
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Tue Nov 03 07:15:44 2020 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Tue Nov 03 07:19:33 2020 +0100
@@ -113,7 +113,7 @@
   {
     ServerContext& context = OrthancRestApi::GetContext(call);
 
-    LOG(INFO) << "Receiving a DICOM file of " << call.GetBodySize() << " bytes through HTTP";
+    CLOG(INFO, REST) << "Receiving a DICOM file of " << call.GetBodySize() << " bytes through HTTP";
 
     if (call.GetBodySize() == 0)
     {
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp	Tue Nov 03 07:15:44 2020 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp	Tue Nov 03 07:19:33 2020 +0100
@@ -1587,8 +1587,8 @@
 
           for (size_t j = 0; j < orthancId.size(); j++)
           {
-            LOG(INFO) << "Storage commitment - Removing SOP instance UID / Orthanc ID: "
-                      << sopInstanceUids[i] << " / " << orthancId[j];
+            CLOG(INFO, REST) << "Storage commitment - Removing SOP instance UID / Orthanc ID: "
+                             << sopInstanceUids[i] << " / " << orthancId[j];
 
             Json::Value tmp;
             context.GetIndex().DeleteResource(tmp, orthancId[j], ResourceType_Instance);
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Tue Nov 03 07:15:44 2020 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Tue Nov 03 07:19:33 2020 +0100
@@ -1351,12 +1351,12 @@
 
     if (ok)
     {
-      LOG(INFO) << "The attachment " << name << " of resource " << publicId << " has the right MD5";
+      CLOG(INFO, REST) << "The attachment " << name << " of resource " << publicId << " has the right MD5";
       call.GetOutput().AnswerBuffer("{}", MimeType_Json);
     }
     else
     {
-      LOG(INFO) << "The attachment " << name << " of resource " << publicId << " has bad MD5!";
+      CLOG(INFO, REST) << "The attachment " << name << " of resource " << publicId << " has bad MD5!";
     }
   }