#include "utils/utils.hpp" #include #include #include "utils/log.hpp" auto getFileName(const std::string& path) -> std::string { return std::filesystem::path(path).filename().string(); } void printWithDots(const std::string& tag, const std::string& filename, const std::string& status) { // Reprodueix l'alineació històrica (amplada total ≈ 50). El logger anteposa // automàticament "tag: ", per això aquí només componem el cos. constexpr std::size_t TOTAL_WIDTH = 50; const std::size_t PREFIX_LEN = tag.size() + 2; // "{tag}: " const std::size_t USED = PREFIX_LEN + status.size(); const std::size_t FIELD = (USED < TOTAL_WIDTH) ? (TOTAL_WIDTH - USED) : 0; std::string body = filename; if (body.size() < FIELD) { body.resize(FIELD, '.'); } Log::info(tag, "{}{}", body, status); }