Init folly and set logtostderr in sample binary
Summary:
By default log messages aren't set to go to stderr
MODIFY
quic/samples/echo/main.cpp
quic/samples/echo/main.cpp
*
*/
-#include <gflags/gflags.h>
#include <glog/logging.h>
+#include <fizz/crypto/Utils.h>
#include <folly/init/Init.h>
+#include <folly/portability/GFlags.h>
#include <quic/samples/echo/EchoClient.h>
#include <quic/samples/echo/EchoServer.h>
@@ -22,9 +23,14 @@ DEFINE_bool(pr, false, "Enable partially realible mode");
using namespace quic::samples;
int main(int argc, char* argv[]) {
+#if FOLLY_HAVE_LIBGFLAGS
+ // Enable glog logging to stderr by default.
+ gflags::SetCommandLineOptionWithMode(
+ "logtostderr", "1", gflags::SET_FLAGS_DEFAULT);
+#endif
gflags::ParseCommandLineFlags(&argc, &argv, false);
- google::InitGoogleLogging(argv[0]);
- folly::ssl::init();
+ folly::Init init(&argc, &argv);
+ fizz::CryptoUtils::init();
if (FLAGS_mode == "server") {
EchoServer server(FLAGS_port, FLAGS_pr);

Init folly and set logtostderr in sample binary

Summary:
By default log messages aren't set to go to stderr
https://github.com/google/glog/blob/5c576f78c49b28d89b23fbb1fc80f54c879ec02e/src/glog/logging.h.in#L1476

Reviewed By: siyengar

Differential Revision: D15145787

fbshipit-source-id: b1de63d840e58cc5eb7fa91b84513cd09a1deeae