The Mega Snivy Update
Some checks failed
Build / Build Game (push) Has been cancelled

This commit is contained in:
2026-02-28 21:48:00 -05:00
parent 8b2edd1359
commit 17f3348e94
163 changed files with 8725 additions and 13281 deletions

48
src/log.hpp Normal file
View File

@@ -0,0 +1,48 @@
#pragma once
#include <filesystem>
#include <fstream>
#include <string>
#include <string_view>
namespace game
{
#define LEVELS \
X(LEVEL_INFO, "[INFO]") \
X(LEVEL_WARNING, "[WARNING]") \
X(LEVEL_ERROR, "[ERROR]") \
X(LEVEL_FATAL, "[FATAL]")
enum Level
{
#define X(symbol, string) symbol,
LEVELS
#undef X
};
constexpr std::string_view LEVEL_STRINGS[] = {
#define X(symbol, string) string,
LEVELS
#undef X
};
#undef LEVELS
class Logger
{
std::ofstream file{};
public:
static std::filesystem::path path();
void write_raw(const std::string&);
void write(const Level, const std::string&);
void info(const std::string&);
void warning(const std::string&);
void error(const std::string&);
void fatal(const std::string&);
void open(const std::filesystem::path&);
Logger();
};
}
extern game::Logger logger;