18 lines
No EOL
461 B
C++
Executable file
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...));
|
|
}
|
|
} |