59 {
60 std::ostringstream oss;
61
62 auto time = std::chrono::system_clock::now();
63 auto time_t = std::chrono::system_clock::to_time_t(time);
64 oss << "[" << std::put_time(std::localtime(&time_t), "%Y-%m-%d %H:%M:%S") << "]";
65
69
70 if constexpr (std::is_same_v<Entry, JournalEntry>) {
71 oss << entry.message;
72 if (entry.location.file_name() != nullptr) {
73 oss << " (" << entry.location.file_name()
74 << ":" << entry.location.line() << ")";
75 }
76 } else {
77 oss << entry.message;
78 if (entry.file_name != nullptr) {
79 oss << " (" << entry.file_name
80 << ":" << entry.line << ")";
81 }
82 }
83
84 return oss.str();
85 }
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)