Make error show the name of the error instead of code

This commit is contained in:
FakeMichau
2024-07-12 21:48:29 +02:00
parent 945c7ff53b
commit 676205c43b
2 changed files with 4 additions and 3 deletions
+1 -3
View File
@@ -1,6 +1,4 @@
#include "log.h"
#include <fstream>
#include <format>
std::ostream null(nullptr);
std::ostream* logStream = &null;
@@ -31,7 +29,7 @@ NvAPI_Status Ok(const std::source_location& location) {
}
NvAPI_Status Error(NvAPI_Status status, const std::source_location& location) {
log(std::format("{}: {}", location.function_name(), std::to_string(status)));
log(std::format("{}: {}", location.function_name(), fromErrorNr(status)));
return status;
}
+3
View File
@@ -3,7 +3,10 @@
#include <chrono>
#include <cstdint>
#include <string>
#include <fstream>
#include <format>
#include <source_location>
#include "util.h"
#include "../include/nvapi.h"
std::string getCurrentTimeFormatted();