From 19fd97e4981ad16d56b30436a462c7e92ceda040 Mon Sep 17 00:00:00 2001
From: mvelosob <miguel.veloso.barros@cern.ch>
Date: Tue, 17 May 2022 10:30:51 +0200
Subject: [PATCH] improve queued retrieve logging (#1220)

---
 ReleaseNotes.md         |  1 +
 scheduler/Scheduler.cpp | 15 +++++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/ReleaseNotes.md b/ReleaseNotes.md
index 2ec5bb55d8..00ec3d11fd 100644
--- a/ReleaseNotes.md
+++ b/ReleaseNotes.md
@@ -6,6 +6,7 @@
 - cta/CTA#1205 - Fail pipeline if cppcheck detects errors
 - cta/CTA#1206 - Change NULL for nullptr
 - cta/CTA#1217 - Schema verification should just issue an warning if there are extra indexes in the db that are not in the catalogue
+- cta/CTA#1220 - Improve queued retrieve logging message
 ### Bug fixes
 ### Building and Packaging
 ### Catalogue Schema
diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp
index d0042da211..8eb1d2e74e 100644
--- a/scheduler/Scheduler.cpp
+++ b/scheduler/Scheduler.cpp
@@ -270,12 +270,15 @@ std::string Scheduler::queueRetrieve(
      .add("reconciliationTime", queueCriteria.archiveFile.reconciliationTime)
      .add("storageClass", queueCriteria.archiveFile.storageClass);
   queueCriteria.archiveFile.checksumBlob.addFirstChecksumToLog(spc);
-  uint32_t copyNumber=0;
-  for (auto & tf:queueCriteria.archiveFile.tapeFiles) {
-    std::stringstream tc;
-    tc << "tapeTapefile" << copyNumber++;
-    spc.add(tc.str(), tf);
-  }
+  
+  const auto &tapeFile = queueCriteria.archiveFile.tapeFiles.front();
+  spc.add("fSeq", tapeFile.fSeq)
+     .add("vid", tapeFile.vid)
+     .add("blockId", tapeFile.blockId)
+     .add("fileSize", tapeFile.fileSize)
+     .add("copyNb", tapeFile.copyNb)
+     .add("creationTime", tapeFile.creationTime);
+  
   spc.add("selectedVid", requestInfo.selectedVid)
      .add("verifyOnly", request.isVerifyOnly)
      .add("catalogueTime", catalogueTime)
-- 
GitLab