Skip to content
Extraits de code Groupes Projets
Vérifiée Valider fb985066 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

LOG: Get ride of the ../ in file with the logs

parent a5fa9a83
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -24,6 +24,7 @@ set(STL_INC
<ctype.h>
<mutex>
<iomanip>
<filesystem>
)
set(EXT_INC PRIVATE
......
......@@ -29,6 +29,12 @@ StderrLogSinkDispatcher::trunkFileName(const char *fileName) noexcept
fileNameView.data() + fileNameView.size() };
}
std::string
StderrLogSinkDispatcher::reduceFileName(const std::string_view fileName) noexcept
{
return std::filesystem::path(fileName).lexically_normal();
}
StderrLogSinkDispatcher::StderrLogSinkDispatcher() noexcept
: LogSinkDispatcher(std::string_view{ "stderr" })
{
......@@ -38,7 +44,7 @@ void
StderrLogSinkDispatcher::handleLogMessage(const std::string_view category,
const LogMessage &msg) noexcept
{
std::cerr << "#(" << trunkFileName(msg.getHeader().fileName) << " +"
std::cerr << "#(" << reduceFileName(trunkFileName(msg.getHeader().fileName)) << " +"
<< msg.getHeader().lineNumberInFile << " | "
<< LogLevel::toStdStringView(msg.getHeader().severity) << " -> " << category << ") "
<< msg.getTextBuffer() << '\n';
......
......@@ -115,6 +115,7 @@ class StderrLogSinkDispatcher : public LogSinkDispatcher {
VIVY_UNMOVABLE_OBJECT(StderrLogSinkDispatcher)
static const std::string_view trunkFileName(const char *) noexcept;
static std::string reduceFileName(const std::string_view) noexcept;
public:
explicit StderrLogSinkDispatcher() noexcept;
......
......@@ -7,12 +7,11 @@ ModuleDeclaration::resolvModules(LuaContext *const context) noexcept
{
for (const auto &str : importNames) {
const ModuleDeclaration *const mod = context->getModule(str);
if (mod) {
if (mod)
importedModules.emplace_back(mod);
} else {
else
context->failedWith("Failed to find needed module: " + str);
return false;
}
}
return true;
}
......
......@@ -111,7 +111,7 @@ VivyApplication::getApplicationFont(Font id) const noexcept
}
// Let the program crash
qFatal("UNREACHABLE");
logFatal() << "Unreachable";
}
MainWindow *
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter