logging overhaul

This commit is contained in:
SimoneN64
2023-06-05 17:07:20 +02:00
parent 9e37e961ba
commit df3775a559
26 changed files with 145 additions and 145 deletions

View File

@@ -7,7 +7,7 @@ inline auto ReadFileBinary(const std::string& path, u32** buf) {
std::ifstream file(path, std::ios::binary);
file.unsetf(std::ios::skipws);
if(!file.is_open()) {
panic("Could not load file '{}'!\n", path);
panic("Could not load file '{}'!", path);
}
file.seekg(0, std::ios::end);

View File

@@ -35,22 +35,22 @@ constexpr void print(const std::string& fmt, Args... args) {
template <typename ...Args>
constexpr void panic(const std::string& fmt, Args... args) {
print<Error>(fmt, args...);
print<Error>(fmt + "\n", args...);
exit(-1);
}
template <typename ...Args>
constexpr void warn(const std::string& fmt, Args... args) {
print<Warn>(fmt, args...);
print<Warn>(fmt + "\n", args...);
}
template <typename ...Args>
constexpr void info(const std::string& fmt, Args... args) {
print(fmt, args...);
print(fmt + "\n", args...);
}
template <typename ...Args>
constexpr void debug(const std::string& fmt, Args... args) {
print<Debug>(fmt, args...);
print<Debug>(fmt + "\n", args...);
}
}