First commit from Arch

This commit is contained in:
2026-01-28 19:22:50 -05:00
parent 15b3e294b5
commit ab28c22446
18 changed files with 54 additions and 11 deletions

58
include/Logger.h Normal file
View File

@@ -0,0 +1,58 @@
#pragma once
#include <string>
#include <source_location>
#include <format>
namespace Log
{
enum class Level
{
Info,
Warning,
Error,
Debug,
VkValidation,
DeviceSetup
};
// void Message(Level Level, const std::source_location& Location = std::source_location::current(), const std::string& Message);
void Message(Level Level, const std::string& Message, const std::source_location& Location);
template <typename... Args>
void Info(const std::string& Format, Args&&... Arguments, const std::source_location& Location = std::source_location::current())
{
Message(Level::Info, std::vformat(Format, std::make_format_args(Arguments...)), Location);
}
template <typename... Args>
void Warning(const std::string& Format, Args&&... Arguments, const std::source_location& Location = std::source_location::current())
{
Message(Level::Warning, std::vformat(Format, std::make_format_args(Arguments...)), Location);
}
template <typename... Args>
void Error(const std::string& Format, Args&&... Arguments, const std::source_location& Location = std::source_location::current())
{
Message(Level::Error, std::vformat(Format, std::make_format_args(Arguments...)), Location);
}
template <typename... Args>
void Debug(const std::string& Format, Args&&... Arguments, const std::source_location& Location = std::source_location::current())
{
Message(Level::Warning, std::vformat(Format, std::make_format_args(Arguments...)), Location);
}
template <typename... Args>
void Validation(const std::string& Format, Args&&... Arguments, const std::source_location& Location = std::source_location::current())
{
Message(Level::VkValidation, std::vformat(Format, std::make_format_args(Arguments...)), Location);
}
template <typename... Args>
void DeviceSetup(const std::string& Format, Args&&... Arguments, const std::source_location& Location = std::source_location::current())
{
Message(Level::DeviceSetup, std::vformat(Format, std::make_format_args(Arguments...)), Location);
}
} // namespace Log