diff Core/FileStorage/MemoryStorageArea.cpp @ 2826:c277e0421200

unit testing of overwriting
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Sep 2018 16:06:41 +0200
parents d7815540bd81
children 4e43e67f8ecf
line wrap: on
line diff
--- a/Core/FileStorage/MemoryStorageArea.cpp	Wed Sep 19 15:24:01 2018 +0200
+++ b/Core/FileStorage/MemoryStorageArea.cpp	Wed Sep 19 16:06:41 2018 +0200
@@ -35,6 +35,7 @@
 #include "MemoryStorageArea.h"
 
 #include "../OrthancException.h"
+#include "../Logging.h"
 
 namespace Orthanc
 {
@@ -54,6 +55,9 @@
                                  size_t size,
                                  FileContentType type)
   {
+    LOG(INFO) << "Creating attachment \"" << uuid << "\" of \"" << static_cast<int>(type)
+              << "\" type (size: " << (size / (1024 * 1024) + 1) << "MB)";
+
     boost::mutex::scoped_lock lock(mutex_);
 
     if (size != 0 &&
@@ -76,6 +80,9 @@
                                const std::string& uuid,
                                FileContentType type)
   {
+    LOG(INFO) << "Reading attachment \"" << uuid << "\" of \""
+              << static_cast<int>(type) << "\" content type";
+
     boost::mutex::scoped_lock lock(mutex_);
 
     Content::const_iterator found = content_.find(uuid);
@@ -98,6 +105,8 @@
   void MemoryStorageArea::Remove(const std::string& uuid,
                                  FileContentType type)
   {
+    LOG(INFO) << "Deleting attachment \"" << uuid << "\" of type " << static_cast<int>(type);
+
     boost::mutex::scoped_lock lock(mutex_);
 
     Content::iterator found = content_.find(uuid);