From 676205c43b8378d2ab0e64b9381d3efe09486ca5 Mon Sep 17 00:00:00 2001 From: FakeMichau <49685661+FakeMichau@users.noreply.github.com> Date: Fri, 12 Jul 2024 21:48:29 +0200 Subject: [PATCH] Make error show the name of the error instead of code --- OptiScaler/nvapi/fakenvapi/log.cpp | 4 +--- OptiScaler/nvapi/fakenvapi/log.h | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OptiScaler/nvapi/fakenvapi/log.cpp b/OptiScaler/nvapi/fakenvapi/log.cpp index 298dcc34..254c46f1 100644 --- a/OptiScaler/nvapi/fakenvapi/log.cpp +++ b/OptiScaler/nvapi/fakenvapi/log.cpp @@ -1,6 +1,4 @@ #include "log.h" -#include -#include 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; } diff --git a/OptiScaler/nvapi/fakenvapi/log.h b/OptiScaler/nvapi/fakenvapi/log.h index 855292a3..96465672 100644 --- a/OptiScaler/nvapi/fakenvapi/log.h +++ b/OptiScaler/nvapi/fakenvapi/log.h @@ -3,7 +3,10 @@ #include #include #include +#include +#include #include +#include "util.h" #include "../include/nvapi.h" std::string getCurrentTimeFormatted();