Extend RGBASM and RGBLINK verbosity flags to have multiple levels like RGBGFX (#1772)

This commit is contained in:
Rangi
2025-08-02 17:10:10 -04:00
committed by GitHub
parent b51056f743
commit 752b273aec
28 changed files with 688 additions and 347 deletions

View File

@@ -18,6 +18,7 @@
#include "helpers.hpp"
#include "util.hpp"
#include "verbosity.hpp"
#include "asm/fixpoint.hpp"
#include "asm/format.hpp"
@@ -325,7 +326,7 @@ void LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
if (filePath == "-") {
path = "<stdin>";
content.emplace<BufferedContent>(STDIN_FILENO);
verbosePrint("Opening stdin\n"); // LCOV_EXCL_LINE
verbosePrint(VERB_INFO, "Opening stdin\n"); // LCOV_EXCL_LINE
} else {
struct stat statBuf;
if (stat(filePath.c_str(), &statBuf) != 0) {
@@ -352,13 +353,17 @@ void LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
}
content.emplace<ViewedContent>(ptr, size);
verbosePrint("File \"%s\" is fully read\n", path.c_str()); // LCOV_EXCL_LINE
// LCOV_EXCL_START
verbosePrint(VERB_INFO, "File \"%s\" is fully read\n", path.c_str());
// LCOV_EXCL_STOP
} else {
// LCOV_EXCL_START
if (statBuf.st_size == 0) {
verbosePrint("File \"%s\" is empty\n", path.c_str());
verbosePrint(VERB_INFO, "File \"%s\" is empty\n", path.c_str());
} else {
verbosePrint("Failed to stat file \"%s\": %s\n", path.c_str(), strerror(errno));
verbosePrint(
VERB_INFO, "Failed to stat file \"%s\": %s\n", path.c_str(), strerror(errno)
);
}
// LCOV_EXCL_STOP
@@ -371,7 +376,7 @@ void LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
}
content.emplace<BufferedContent>(fd);
verbosePrint("File \"%s\" is opened\n", path.c_str()); // LCOV_EXCL_LINE
verbosePrint(VERB_INFO, "File \"%s\" is opened\n", path.c_str()); // LCOV_EXCL_LINE
}
}