logging: if folly::format() fails, also log the arguments
authorAdam Simpkins <simpkins@fb.com>
Tue, 13 Jun 2017 01:33:06 +0000 (18:33 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 13 Jun 2017 01:38:15 +0000 (18:38 -0700)
commitba74a196a02f5b75d90225bb3ab7cb441ae58de5
treec7a588f2a4210ce2c6d30434c114fbdec030b438
parentdc2c2837d095c9d3a5407e939a88b982ba37858a
logging: if folly::format() fails, also log the arguments

Summary:
If the folly::sformat() call fails in an FB_LOGF() statement, make a
best-effort attempt to log the format arguments as well, in addition to the
format string.  For each argument, folly::to<std::string>() is use if it is
supported for this argument.

This will help ensure that the arguments that were being logged aren't lost
even if the format string was incorrect.

Reviewed By: WillerZ

Differential Revision: D5082978

fbshipit-source-id: 0d56030e639cd7e8f2242bb43646ab4248c6a877
folly/experimental/logging/LogStreamProcessor.h
folly/experimental/logging/test/LoggerTest.cpp