logging overhaul
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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...);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user