changeset 102:663566c7bc0f

rename option "EnableVerboseLogs" as "Verbose", protect it by mutex
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Aug 2026 14:39:45 +0200
parents b8810b2fcd75
children e0121c8ef118
files NEWS Sources/EducationConfiguration.cpp Sources/EducationConfiguration.h Sources/LTI/LTIRoutes.cpp Sources/Plugin.cpp
diffstat 5 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Aug 19 14:30:49 2026 +0200
+++ b/NEWS	Wed Aug 19 14:39:45 2026 +0200
@@ -6,13 +6,13 @@
 * Disabled "Expect: 100-continue" HTTP header during LTI registration,
   which is not always properly handled by certain LTI deployments
   (e.g., if HAProxy is put in front of Moodle)
-* New configuration "EnableVerboseLogs" to display more information, amongst other,
-  during LTI configuration.
+* New "Verbose" configuration option to display additional information,
+  notably during LTI configuration
 * REST API: Job ID is reported when starting the DICOM-ization, and upload ID
   is part of the DICOM-ization status
 * Added CMake option "ORTHANC_SDK_VERSION"
 * Added internal route to get project information from other plugins:
-  "/education/api-plugins/project-info"
+  "/education/api-plugins/project"
 
 
 Version 1.1 (2025-11-07)
--- a/Sources/EducationConfiguration.cpp	Wed Aug 19 14:30:49 2026 +0200
+++ b/Sources/EducationConfiguration.cpp	Wed Aug 19 14:39:45 2026 +0200
@@ -56,7 +56,7 @@
   hasPluginVolView_(false),
   hasPluginWholeSlideImaging_(false),
   hasPluginOhif_(false),
-  isVerboseLogsEnabled_(false),
+  isVerbose_(false),
   sequenceProjectIds_(0)
 {
 }
@@ -733,12 +733,15 @@
 }
 
 
-void EducationConfiguration::SetVerboseLogsEnabled(bool enable)
+void EducationConfiguration::SetVerbose(bool isVerbose)
 {
-  isVerboseLogsEnabled_ = enable;
+  boost::unique_lock<boost::shared_mutex> lock(mutex_);
+  isVerbose_ = isVerbose;
 }
 
-bool EducationConfiguration::IsVerboseLogsEnabled() const
+
+bool EducationConfiguration::IsVerbose()
 {
-  return isVerboseLogsEnabled_;
+  boost::shared_lock<boost::shared_mutex> lock(mutex_);
+  return isVerbose_;
 }
--- a/Sources/EducationConfiguration.h	Wed Aug 19 14:30:49 2026 +0200
+++ b/Sources/EducationConfiguration.h	Wed Aug 19 14:39:45 2026 +0200
@@ -67,7 +67,7 @@
   bool                   hasPluginVolView_;
   bool                   hasPluginWholeSlideImaging_;
   bool                   hasPluginOhif_;
-  bool                   isVerboseLogsEnabled_;
+  bool                   isVerbose_;
 
   unsigned int           sequenceProjectIds_;
 
@@ -193,7 +193,7 @@
                                                 const char* const* headersKeys,
                                                 const char* const* headersValues);
 
-  void SetVerboseLogsEnabled(bool enable);
+  void SetVerbose(bool isVerbose);
 
-  bool IsVerboseLogsEnabled() const;
+  bool IsVerbose();
 };
--- a/Sources/LTI/LTIRoutes.cpp	Wed Aug 19 14:30:49 2026 +0200
+++ b/Sources/LTI/LTIRoutes.cpp	Wed Aug 19 14:39:45 2026 +0200
@@ -184,16 +184,17 @@
     std::map<std::string, std::string> form;
     HttpToolbox::ParseFormUrlEncoded(form, request->body, request->bodySize);
 
-    if (EducationConfiguration::GetInstance().IsVerboseLogsEnabled())
+    if (EducationConfiguration::GetInstance().IsVerbose())
     {
-      LOG(INFO) << "ServeLaunch payload: " << std::string(reinterpret_cast<const char*>(request->body), static_cast<size_t>(request->bodySize));
+      LOG(INFO) << "Payload received by ServeLaunch(): "
+                << std::string(reinterpret_cast<const char*>(request->body), static_cast<size_t>(request->bodySize));
     }
 
     CheckState(form, request);
 
     JWT jwt(HttpToolbox::ReadMandatoryString(form, "id_token"));
 
-    if (EducationConfiguration::GetInstance().IsVerboseLogsEnabled())
+    if (EducationConfiguration::GetInstance().IsVerbose())
     {
       LOG(INFO) << "Verifying JWT: " << HttpToolbox::ReadMandatoryString(form, "id_token");
     }
--- a/Sources/Plugin.cpp	Wed Aug 19 14:30:49 2026 +0200
+++ b/Sources/Plugin.cpp	Wed Aug 19 14:39:45 2026 +0200
@@ -667,7 +667,7 @@
       OrthancPluginRegisterHttpAuthentication(context, HttpAuthentication);
       OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback);
 
-      EducationConfiguration::GetInstance().SetVerboseLogsEnabled(configEducation.GetBooleanValue("EnableVerboseLogs", false));
+      EducationConfiguration::GetInstance().SetVerbose(configEducation.GetBooleanValue("Verbose", false));
 
       std::string s;
       if (configEducation.LookupStringValue(s, "AuthenticationHttpHeader"))