Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
prism/engine/log/include/log.hpp

18 lines
No EOL
461 B
C++
Executable file

#pragma once
#include <fmt/format.h>
namespace prism {
inline std::string log_output;
inline void vlog(fmt::string_view format, fmt::format_args args) {
auto str = fmt::vformat(format, args);
fmt::print("{}", str);
log_output += str + "\n";
}
template <typename S, typename... Args>
inline void log(const S& format, Args&&... args) {
vlog(format, fmt::make_args_checked<Args...>(format, args...));
}
}