logging: add an initLoggingOrDie() function
Summary: Add folly::initLoggingOrDie(), which behaves like `initLogging()` but handles errors by printing a message to stderr and then calling `exit(1)`. Most programs are expected to initialize logging early on during program start-up, and will likely use a command line argument or other configuration value as the logging settings. If an error occurs they usually want to print the message to stderr and exit unsuccesfully. `initLoggingOrDie()` makes it easy to perform these steps without requiring programs to write their own exception handlers to handle errors from `initLogging()`. Reviewed By: chadaustin Differential Revision: D7164830 fbshipit-source-id: d688046f1b6240c948e4aaabfc9fb24ba3d9ff89
Showing
Please register or sign in to comment