Skip to content

Commit 99e5f1b

Browse files
committed
fix logging: fix compilation with fmt 10
1 parent 1d6f13b commit 99e5f1b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

universal/src/logging/log_helper_impl.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ constexpr std::string_view kTimeTemplate = "0000-00-00T00:00:00";
4646
struct TimeString final {
4747
char data[kTimeTemplate.size()]{};
4848

49-
/*implicit*/ operator std::string_view() const noexcept {
49+
std::string_view ToStringView() const noexcept {
5050
return {data, std::size(data)};
5151
}
5252
};
@@ -107,9 +107,10 @@ void LogHelper::Impl::PutMessageBegin() {
107107
const auto now = TimePoint::clock::now();
108108
const auto level_string = logging::ToUpperCaseString(level_);
109109
msg_.resize(kTemplate.size() + level_string.size());
110-
fmt::format_to(
111-
msg_.data(), FMT_COMPILE("tskv\ttimestamp={}.{:06}\tlevel={}"),
112-
GetCurrentTimeString(now), FractionalMicroseconds(now), level_string);
110+
fmt::format_to(msg_.data(),
111+
FMT_COMPILE("tskv\ttimestamp={}.{:06}\tlevel={}"),
112+
GetCurrentTimeString(now).ToStringView(),
113+
FractionalMicroseconds(now), level_string);
113114
return;
114115
}
115116
case Format::kLtsv: {
@@ -119,8 +120,8 @@ void LogHelper::Impl::PutMessageBegin() {
119120
const auto level_string = logging::ToUpperCaseString(level_);
120121
msg_.resize(kTemplate.size() + level_string.size());
121122
fmt::format_to(msg_.data(), FMT_COMPILE("timestamp:{}.{:06}\tlevel:{}"),
122-
GetCurrentTimeString(now), FractionalMicroseconds(now),
123-
level_string);
123+
GetCurrentTimeString(now).ToStringView(),
124+
FractionalMicroseconds(now), level_string);
124125
return;
125126
}
126127
case Format::kRaw: {

0 commit comments

Comments
 (0)