# HG changeset patch # User Alain Mazy # Date 1713860835 -7200 # Node ID e791a74ea9467aa635e9494c172fbe819b3a44cc # Parent e02cdf358905790c50e41c89a1909e80b34692dc# Parent fa000bd60bbe994c8bf153a86314ac9429c89acf merge diff -r fa000bd60bbe -r e791a74ea946 OrthancFramework/Sources/Logging.cpp --- a/OrthancFramework/Sources/Logging.cpp Tue Apr 23 09:55:51 2024 +0200 +++ b/OrthancFramework/Sources/Logging.cpp Tue Apr 23 10:27:15 2024 +0200 @@ -913,7 +913,7 @@ if (loggingStreamsContext_.get() == NULL) { - fprintf(stderr, "ERROR: Trying to log a message after the finalization of the logging engine\n"); + fprintf(stderr, "ERROR: Trying to log a message after the finalization of the logging engine (or did you forgot to initialize it ?)\n"); // have you called Orthanc::Logging::InitializePluginContext ? lock_.unlock(); return; } diff -r fa000bd60bbe -r e791a74ea946 OrthancServer/Plugins/Samples/DelayedDeletion/Plugin.cpp --- a/OrthancServer/Plugins/Samples/DelayedDeletion/Plugin.cpp Tue Apr 23 09:55:51 2024 +0200 +++ b/OrthancServer/Plugins/Samples/DelayedDeletion/Plugin.cpp Tue Apr 23 10:27:15 2024 +0200 @@ -289,8 +289,8 @@ { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { - OrthancPlugins::SetGlobalContext(context); - Orthanc::Logging::InitializePluginContext(context); + OrthancPlugins::SetGlobalContext(context, ORTHANC_PLUGIN_NAME); + Orthanc::Logging::InitializePluginContext(context, ORTHANC_PLUGIN_NAME); /* Check the version of the Orthanc core */ diff -r fa000bd60bbe -r e791a74ea946 OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp --- a/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp Tue Apr 23 09:55:51 2024 +0200 +++ b/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp Tue Apr 23 10:27:15 2024 +0200 @@ -795,7 +795,8 @@ ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c) { - OrthancPlugins::SetGlobalContext(c); + OrthancPlugins::SetGlobalContext(c, HOUSEKEEPER_NAME); + Orthanc::Logging::InitializePluginContext(c, HOUSEKEEPER_NAME); /* Check the version of the Orthanc core */ if (OrthancPluginCheckVersion(c) == 0) diff -r fa000bd60bbe -r e791a74ea946 OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp --- a/OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp Tue Apr 23 09:55:51 2024 +0200 +++ b/OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp Tue Apr 23 10:27:15 2024 +0200 @@ -214,7 +214,8 @@ { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c) { - OrthancPlugins::SetGlobalContext(c); + Orthanc::Logging::InitializePluginContext(c, MODALITY_WORKLISTS_NAME); + OrthancPlugins::SetGlobalContext(c, MODALITY_WORKLISTS_NAME); /* Check the version of the Orthanc core */ if (OrthancPluginCheckVersion(c) == 0) diff -r fa000bd60bbe -r e791a74ea946 OrthancServer/Plugins/Samples/MultitenantDicom/Plugin.cpp --- a/OrthancServer/Plugins/Samples/MultitenantDicom/Plugin.cpp Tue Apr 23 09:55:51 2024 +0200 +++ b/OrthancServer/Plugins/Samples/MultitenantDicom/Plugin.cpp Tue Apr 23 10:27:15 2024 +0200 @@ -121,6 +121,7 @@ ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { OrthancPlugins::SetGlobalContext(context, ORTHANC_PLUGIN_NAME); + Orthanc::Logging::InitializePluginContext(context, ORTHANC_PLUGIN_NAME); /* Check the version of the Orthanc core */ if (OrthancPluginCheckVersion(OrthancPlugins::GetGlobalContext()) == 0) @@ -135,18 +136,6 @@ return -1; } -#if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 7, 2) - Orthanc::Logging::InitializePluginContext(context); -#else - Orthanc::Logging::Initialize(context); -#endif - - if (!OrthancPlugins::CheckMinimalOrthancVersion(1, 12, 4)) - { - OrthancPlugins::ReportMinimalOrthancVersion(1, 12, 4); - return -1; - } - OrthancPluginSetDescription2(context, ORTHANC_PLUGIN_NAME, "Multitenant plugin for Orthanc."); OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback); diff -r fa000bd60bbe -r e791a74ea946 OrthancServer/Plugins/Samples/ServeFolders/Plugin.cpp --- a/OrthancServer/Plugins/Samples/ServeFolders/Plugin.cpp Tue Apr 23 09:55:51 2024 +0200 +++ b/OrthancServer/Plugins/Samples/ServeFolders/Plugin.cpp Tue Apr 23 10:27:15 2024 +0200 @@ -416,7 +416,8 @@ { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { - OrthancPlugins::SetGlobalContext(context); + OrthancPlugins::SetGlobalContext(context, SERVE_FOLDERS_NAME); + Orthanc::Logging::InitializePluginContext(context, SERVE_FOLDERS_NAME); /* Check the version of the Orthanc core */ if (OrthancPluginCheckVersion(context) == 0)