#pragma once #include #include #include #include enum log_lvl { trace = 0, debug, info, warn, error, critical }; namespace io { template void log(std::string_view msg, Args... params) { spdlog::log(static_cast(T), msg.data(), std::forward(params)...); } static std::vector read_file(std::string_view name) { std::ifstream file(name.data(), std::ios::binary); if (!file.good()) { return {}; } std::vector out; file.seekg(0, std::ios::end); std::streampos length = file.tellg(); file.seekg(0, std::ios::beg); out.resize(length); file.read((char*)out.data(), length); return out; } };