33 static std::string
do_format(
FLogPack pack,
const fmt::format_string<Args...>& fmt, Args&&... args) {
35 if (
sizeof...(args) == 0) {
36 f_msg = fmt.get().data();
39 f_msg = fmt::format(fmt, std::forward<Args>(args)...);
40 }
catch (fmt::format_error& e) {
44 const auto tp = std::chrono::system_clock::time_point(std::chrono::milliseconds(pack.time));
46 const char* level_str;
48 case LogLevel::TRACE: level_str =
"[TRACE]";
50 case LogLevel::DEBUG: level_str =
"[DEBUG]";
52 case LogLevel::INFO: level_str =
"[INFO]";
54 case LogLevel::WARN: level_str =
"[WARN]";
56 case LogLevel::ERROR: level_str =
"[ERROR]";
58 case LogLevel::FATAL: level_str =
"[FATAL]";
60 default: level_str =
"[OUT]";
65 "{:%Y-%m-%d %H:%M:%S} [{}] {} {}",
66 std::chrono::time_point_cast<std::chrono::milliseconds>(tp),