diff OrthancServer/Plugins/Engine/PluginsManager.cpp @ 5571:addccb1590d2

simplifying Orthanc::Logging
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Apr 2024 14:48:11 +0200
parents 0b18690c1935
children a7c88563c8cc
line wrap: on
line diff
--- a/OrthancServer/Plugins/Engine/PluginsManager.cpp	Thu Apr 25 17:16:51 2024 +0200
+++ b/OrthancServer/Plugins/Engine/PluginsManager.cpp	Fri Apr 26 14:48:11 2024 +0200
@@ -162,16 +162,16 @@
         return OrthancPluginErrorCode_Success;
 
       case _OrthancPluginService_LogMessage:
-        {
-          const _OrthancPluginLogMessage& m = *reinterpret_cast<const _OrthancPluginLogMessage*>(params);
-          // we may convert directly from OrthancPluginLogLevel to LogLevel (and category) because the enum values must be identical 
-          // for Orthanc::Logging to work both in the core and in the plugins
-          Orthanc::Logging::LogLevel level = static_cast<Orthanc::Logging::LogLevel>(m.level);
-          Orthanc::Logging::LogCategory category = static_cast<Orthanc::Logging::LogCategory>(m.category);
+      {
+        const _OrthancPluginLogMessage& m = *reinterpret_cast<const _OrthancPluginLogMessage*>(params);
+        // We can convert directly from OrthancPluginLogLevel to LogLevel (and category) because the enum values must be identical 
+        // for Orthanc::Logging to work both in the core and in the plugins
+        Orthanc::Logging::LogLevel level = static_cast<Orthanc::Logging::LogLevel>(m.level);
+        Orthanc::Logging::LogCategory category = static_cast<Orthanc::Logging::LogCategory>(m.category);
           
-          LOG_FROM_PLUGIN(level, category, m.plugin, m.file, m.line) << m.message;
-          return OrthancPluginErrorCode_Success;
-        };
+        LOG_FROM_PLUGIN(level, category, m.plugin, m.file, m.line) << m.message;
+        return OrthancPluginErrorCode_Success;
+      }
 
       default:
         break;