From ce3db67e5f19796acdcb20ef8a238106e0984046 Mon Sep 17 00:00:00 2001 From: pacbypass Date: Thu, 16 Jan 2025 16:12:16 +0100 Subject: [PATCH] LOG() call with stringstream --- cpp/src/phonenumbers/utf/unicodetext.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cpp/src/phonenumbers/utf/unicodetext.cc b/cpp/src/phonenumbers/utf/unicodetext.cc index 5fe9ad31e..63a7d1462 100644 --- a/cpp/src/phonenumbers/utf/unicodetext.cc +++ b/cpp/src/phonenumbers/utf/unicodetext.cc @@ -371,15 +371,20 @@ void UnicodeText::push_back(char32 c) { if (UniLib::IsInterchangeValid(buf, len)) { repr_.append(buf, len); } else { - LOG(WARNING) << "Unicode value 0x" << hex << c << " is not valid for interchange"; + std::ostringstream oss; + oss << "Unicode value 0x" << std::hex << c << " is not valid for interchange"; + LOG(WARNING) << oss.str(); repr_.append(" ", 1); } } else { - LOG(WARNING) << "Illegal Unicode value: 0x" << hex << c; + std::ostringstream oss; + oss << "Illegal Unicode value: 0x" << std::hex << c; + LOG(WARNING) << oss.str(); repr_.append(" ", 1); } } + int UnicodeText::size() const { return CodepointCount(repr_.data_, repr_.size_); }