comparison OrthancServer/Plugins/Samples/DelayedDeletion/Plugin.cpp @ 5561:0b18690c1935

SDK: added OrthancPluginLogMessage to display plugin name + file and line from plugin
author Alain Mazy <am@orthanc.team>
date Tue, 23 Apr 2024 09:34:02 +0200
parents 6ce05f8b5b13
children e02cdf358905
comparison
equal deleted inserted replaced
5560:c80dbbae3f60 5561:0b18690c1935
115 std::unique_ptr<Orthanc::IMemoryBuffer> buffer(storage_->Read(uuid, Convert(type))); 115 std::unique_ptr<Orthanc::IMemoryBuffer> buffer(storage_->Read(uuid, Convert(type)));
116 116
117 // copy from a buffer allocated on plugin's heap into a buffer allocated on core's heap 117 // copy from a buffer allocated on plugin's heap into a buffer allocated on core's heap
118 if (OrthancPluginCreateMemoryBuffer64(OrthancPlugins::GetGlobalContext(), target, buffer->GetSize()) != OrthancPluginErrorCode_Success) 118 if (OrthancPluginCreateMemoryBuffer64(OrthancPlugins::GetGlobalContext(), target, buffer->GetSize()) != OrthancPluginErrorCode_Success)
119 { 119 {
120 OrthancPlugins::LogError("Delayed deletion plugin: error while reading object " + std::string(uuid) + ", cannot allocate memory of size " + boost::lexical_cast<std::string>(buffer->GetSize()) + " bytes"); 120 LOG(ERROR) << "Delayed deletion plugin: error while reading object " << uuid << ", cannot allocate memory of size " << buffer->GetSize() << " bytes";
121 return OrthancPluginErrorCode_StorageAreaPlugin; 121 return OrthancPluginErrorCode_StorageAreaPlugin;
122 } 122 }
123 123
124 memcpy(target->data, buffer->GetData(), buffer->GetSize()); 124 memcpy(target->data, buffer->GetData(), buffer->GetSize());
125 125