Skip to content

Commit 575c017

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
folly->format -> fmt::format in xplat/folly/logging (misc)
Summary: folly::format is deprecated in favor of fmt::format. This diff replaces all instances of folly::format with fmt::format. - If you approve of this diff, please use the "Accept & Ship" button :-) ignore-commit-rate-limit Differential Revision: D104906090 fbshipit-source-id: 778205388e04e4ed6230e73e1ee55afce776b3ce
1 parent ef4402a commit 575c017

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

folly/logging/CustomLogFormatter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <fmt/core.h>
1718
#include <folly/logging/CustomLogFormatter.h>
1819

1920
#include <algorithm>
@@ -270,8 +271,8 @@ std::string CustomLogFormatter::formatMessage(
270271
// Most common logs will be single line logs and so we can format the entire
271272
// log string including the message at once.
272273
if (!message.containsNewlines()) {
273-
return folly::sformat(
274-
singleLineLogFormat_,
274+
return fmt::format(
275+
fmt::runtime(singleLineLogFormat_),
275276
getGlogLevelName(message.getLevel())[0],
276277
ltime.tm_mon + 1,
277278
ltime.tm_mday,
@@ -296,8 +297,8 @@ std::string CustomLogFormatter::formatMessage(
296297
// If the message contains multiple lines, ensure that the log header is
297298
// prepended before each message line.
298299
else {
299-
const auto header = folly::sformat(
300-
logFormat_,
300+
const auto header = fmt::format(
301+
fmt::runtime(logFormat_),
301302
getGlogLevelName(message.getLevel())[0],
302303
ltime.tm_mon + 1,
303304
ltime.tm_mday,

0 commit comments

Comments
 (0)