This commit is contained in:
Mars 2025-02-16 22:43:04 -05:00
parent 95374d942d
commit f9a9491da3
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
9 changed files with 141 additions and 103 deletions

View file

@ -38,8 +38,8 @@ void LogImpl(LogLevel level, const std::source_location& loc, fmt::format_string
}
}();
const std::string filename = std::filesystem::path(loc.file_name()).lexically_normal().string();
const struct tm time = *std::localtime(&now);
const string filename = std::filesystem::path(loc.file_name()).lexically_normal().string();
const struct tm time = *std::localtime(&now);
// Timestamp and level
fmt::print(fg(log_colors::timestamp), "[{:%H:%M:%S}] ", time);
@ -60,7 +60,7 @@ void LogImpl(LogLevel level, const std::source_location& loc, fmt::format_string
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-macros"
#ifdef NDEBUG
#define DEBUG_LOG(...) (void)0
#define DEBUG_LOG(...) static_cast<void>(0)
#else
#define DEBUG_LOG(...) LogImpl(LogLevel::DEBUG, std::source_location::current(), __VA_ARGS__)
#endif