17 lines
No EOL
477 B
C++
Executable file
17 lines
No EOL
477 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("{}\n", 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...));
|
|
}
|
|
} // namespace prism
|