#pragma once #include #include #include #include namespace keel::log { enum class Level { Info, Warn, Error }; struct Line { Level level; std::string text; }; void write(Level level, std::string_view text); // The last few thousand lines, for the console. const std::vector& history(); void clearHistory(); template void info(std::format_string f, A&&... a) { write(Level::Info, std::format(f, std::forward(a)...)); } template void warn(std::format_string f, A&&... a) { write(Level::Warn, std::format(f, std::forward(a)...)); } template void error(std::format_string f, A&&... a) { write(Level::Error, std::format(f, std::forward(a)...)); } } // namespace keel::log