logging: add printf-style logging macros
authorAdam Simpkins <simpkins@fb.com>
Wed, 21 Jun 2017 02:44:18 +0000 (19:44 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 21 Jun 2017 02:50:53 +0000 (19:50 -0700)
commitcf984921c268141c3cf5174e27ad3e62e3614151
tree2b5b5477937abd591d41bf9358cb9a25314082f2
parente38fcb3a67efeeaaa5a5906106dee6591bbe7e31
logging: add printf-style logging macros

Summary:
Add new `FB_LOGC()` and `XLOGC()` macros that accept C-style printf format
strings.  (The `FB_LOGF()` and `XLOGF()` macro names are already used for
`folly::format()` style formatting.)

This will make it easier for users to update existing printf-style code to use
this new logging library.

These are in a separate `printf.h` header file that must be explicitly included
to have access to these macros.  The intent is to encourage users to use one of
the other APIs (streaming, append-style, or `folly::format()`) instead of these
printf-like APIs in new code.

Reviewed By: omry

Differential Revision: D5269974

fbshipit-source-id: 56e55f9642bb00806d9b4c762fb6a91778ef6ad3
folly/Makefile.am
folly/experimental/logging/LogStreamProcessor.cpp
folly/experimental/logging/LogStreamProcessor.h
folly/experimental/logging/Makefile.am
folly/experimental/logging/printf.cpp [new file with mode: 0644]
folly/experimental/logging/printf.h [new file with mode: 0644]
folly/experimental/logging/test/PrintfTest.cpp [new file with mode: 0644]