From 789338c8e1883540a0ef9b1495494df90c29b51d Mon Sep 17 00:00:00 2001 From: Srivats P Date: Sun, 28 Mar 2021 12:50:29 +0530 Subject: [PATCH] Add startup/shutdown console prints --- rpc/rpcserver.cpp | 4 ++++ server/drone_main.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/rpc/rpcserver.cpp b/rpc/rpcserver.cpp index 4bb59b4..af074bd 100644 --- a/rpc/rpcserver.cpp +++ b/rpc/rpcserver.cpp @@ -53,6 +53,10 @@ bool RpcServer::registerService(::google::protobuf::Service *service, qDebug("The server is running on %s: %d", qPrintable(serverAddress().toString()), serverPort()); + fprintf(stderr, "Ready to send traffic! Listening on %s:%d ...\n", + qPrintable(serverAddress().toString()), + serverPort()); + fflush(stderr); return true; } diff --git a/server/drone_main.cpp b/server/drone_main.cpp index 1916455..089dc8c 100644 --- a/server/drone_main.cpp +++ b/server/drone_main.cpp @@ -46,6 +46,8 @@ void NoMsgHandler(QtMsgType type, const QMessageLogContext &context, void cleanup(int /*signum*/) { + fprintf(stderr, "\nCleaning up ... (may take a few seconds) ... "); + fflush(stderr); QCoreApplication::instance()->exit(-1); } @@ -54,6 +56,9 @@ int main(int argc, char *argv[]) int exitCode = 0; QCoreApplication app(argc, argv); + fprintf(stderr, "Starting (will take a few seconds) ...\n"); + fflush(stderr); + app.setApplicationName("Drone"); app.setOrganizationName("Ostinato"); @@ -113,6 +118,9 @@ _exit: google::protobuf::ShutdownProtobufLibrary(); + fprintf(stderr, "done.\n"); + fflush(stderr); + return exitCode; }