From 5bb9f2c28a4d0b217ccc9251d51baecd3f8b3453 Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Sun, 3 Aug 2025 20:50:00 +0100 Subject: [PATCH] Added indexing to container logging --- Common/modules/IO.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Common/modules/IO.h b/Common/modules/IO.h index 3db3953..cbd505f 100644 --- a/Common/modules/IO.h +++ b/Common/modules/IO.h @@ -187,13 +187,16 @@ namespace LXC::Util Internal::WriteImpl(std::cout, "[LXC] \"", containerName, "\":\n{"); // Iterates over each of the items in the container and prints them // + unsigned counter = 0; for (const auto& item : container) { if constexpr (Internal::HasLogStrFunc) - Internal::WriteImpl(std::cout, '\t', item.LogStr()); + Internal::WriteImpl(std::cout, '\t', std::setw(3), std::left, counter, "| ", item.LogStr()); else - Internal::WriteImpl(std::cout, '\t', item); + Internal::WriteImpl(std::cout, '\t', std::setw(3), std::left, counter, "| ", item); + + counter++; } // Prints the ending bracket // @@ -256,13 +259,16 @@ namespace LXC::Util Internal::WriteImpl(log, "[LXC] \"", containerName, "\":\n{"); // Iterates over each of the items in the container and prints them // + unsigned counter = 0; for (const auto& item : container) { if constexpr (Internal::HasLogStrFunc) - Internal::WriteImpl(log, '\t', item.LogStr()); + Internal::WriteImpl(log, '\t', std::setw(3), std::left, counter, "| ", item.LogStr()); else - Internal::WriteImpl(log, '\t', item); + Internal::WriteImpl(log, '\t', std::setw(3), std::left, counter, "| ", item); + + counter++; } // Prints the ending bracket //