Add CaptureFD for log testing (and some glog patterns)
Summary:
Without a gadget like this, it's really hard to test logging output. With it, it's really easy. I found about 50 callsites to the various functions across several projects, so folly seems appropriate.
PS The patterns are functions for two reasons:
- Static variables are a pain.
- This leaves the option of adding an optional argument, so you can grep for a particular kind of error string.
Test Plan: unit test
Reviewed By: yfeldblum@fb.com
Subscribers: folly-diffs@, yfeldblum
FB internal diff:
D1933439
Signature: t1:
1933439:
1427345479:
5b3d1c6566a026fdbccb16b382211688e327ea1a