Skip to content

Commit

Permalink
Make error show the name of the error instead of code
Browse files Browse the repository at this point in the history
  • Loading branch information
FakeMichau committed Jul 12, 2024
1 parent 302c6c8 commit 2297982
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/log.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "log.h"
#include <fstream>
#include <format>

std::ostream null(nullptr);
std::ostream* logStream = &null;
Expand Down Expand Up @@ -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;
}

Expand Down
3 changes: 3 additions & 0 deletions src/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2297982

Please sign in to comment.