logging: add support for streaming operators
Summary:
Update the logging library so that FB_LOG() and FB_LOGF() also accept
streaming style arguments:
FB_LOG(logger) << "logs can be written like this now: " << 1234;
FB_LOG(logger, "both styles can be used") << " together";
FB_LOGF(logger, "test: {}, {}", 1234, 5678) << " and with FB_LOGF() too";
Streaming support does make the upcoming XLOG() macros more complicated to
implement, since the macro has to expand to a single ternary `?` expression.
However I was able to come up with a solution that works and has minimal
overhead.
Reviewed By: wez
Differential Revision:
D5082979
fbshipit-source-id:
11734e39c02ad28aceb44bbfbd137d781caa30cf