Skip to content

Commit 4f8bdbd

Browse files
committed
Replace fmt::localtime with std::localtime
fmt::localtime was deprecated in fmt 11.2.0 and removed in fmt 12.0.0. Replace with std::localtime from <ctime> which is already included transitively. Fixes #2456 Signed-off-by: Kefu Chai <tchaikov@gmail.com>
1 parent 6ce2bc0 commit 4f8bdbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/logging.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ void logger_t::generate_common_prefix(std::string *str,
2727
fmt::text_style const &ts,
2828
char const *prefix) const
2929
{
30+
auto const now = std::time(nullptr);
3031
*str += fmt::format("{:%Y-%m-%d %H:%M:%S} ",
31-
fmt::localtime(std::time(nullptr)));
32+
*std::localtime(&now));
3233

3334
if (m_current_level == log_level::debug) {
3435
*str += fmt::format(ts, "[{:02d}] ", this_thread_num);

0 commit comments

Comments
 (0)