diff options
Diffstat (limited to 'gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc')
-rw-r--r-- | gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc b/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc index 603f82dee1..c2613c5c80 100644 --- a/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc +++ b/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc @@ -25,12 +25,13 @@ using namespace rpcpmtconverter; rpcserver_thrift::rpcserver_thrift() { - // std::cerr << "rpcserver_thrift::ctor" << std::endl; + gr::configure_default_loggers(logger, debug_logger, "rpcserver_thrift"); + // std::cerr << "rpcserver_thrift::ctor" ; } rpcserver_thrift::~rpcserver_thrift() { - // std::cerr << "rpcserver_thrift::dtor" << std::endl; + // std::cerr << "rpcserver_thrift::dtor" ; } void rpcserver_thrift::registerConfigureCallback(const std::string& id, @@ -43,13 +44,15 @@ void rpcserver_thrift::registerConfigureCallback(const std::string& id, std::stringstream s; s << "rpcserver_thrift:: rpcserver_thrift ERROR registering set, already " "registered: " - << id << std::endl; + << id; throw std::runtime_error(s.str().c_str()); } } if (DEBUG) { - std::cerr << "rpcserver_thrift registering set: " << id << std::endl; + std::ostringstream msg; + msg << "registering set: " << id; + GR_LOG_INFO(d_debug_logger, msg.str()); } d_setcallbackmap.insert(ConfigureCallbackMap_t::value_type(id, callback)); } @@ -62,12 +65,15 @@ void rpcserver_thrift::unregisterConfigureCallback(const std::string& id) std::stringstream s; s << "rpcserver_thrift:: rpcserver_thrift ERROR unregistering set, not " "registered: " - << id << std::endl; + << id; throw std::runtime_error(s.str().c_str()); } - if (DEBUG) - std::cerr << "rpcserver_thrift unregistering set: " << id << std::endl; + if (DEBUG) { + std::ostringstream msg; + msg << "unregistering set: " << id; + GR_LOG_INFO(d_debug_logger, msg.str()); + } d_setcallbackmap.erase(iter); } @@ -82,13 +88,15 @@ void rpcserver_thrift::registerQueryCallback(const std::string& id, std::stringstream s; s << "rpcserver_thrift:: rpcserver_thrift ERROR registering get, already " "registered: " - << id << std::endl; + << id; throw std::runtime_error(s.str().c_str()); } } if (DEBUG) { - std::cerr << "rpcserver_thrift registering get: " << id << std::endl; + std::ostringstream msg; + msg << "registering get: " << id; + GR_LOG_INFO(d_debug_logger, msg.str()); } d_getcallbackmap.insert(QueryCallbackMap_t::value_type(id, callback)); } @@ -100,12 +108,14 @@ void rpcserver_thrift::unregisterQueryCallback(const std::string& id) if (iter == d_getcallbackmap.end()) { std::stringstream s; s << "rpcserver_thrift:: rpcserver_thrift ERROR unregistering get, registered: " - << id << std::endl; + << id; throw std::runtime_error(s.str().c_str()); } if (DEBUG) { - std::cerr << "rpcserver_thrift unregistering get: " << id << std::endl; + std::ostringstream msg; + msg << "unregistering get: " << id; + GR_LOG_INFO(d_debug_logger, msg.str()); } d_getcallbackmap.erase(iter); @@ -122,13 +132,15 @@ void rpcserver_thrift::registerHandlerCallback(const std::string& id, std::stringstream s; s << "rpcserver_thrift:: rpcserver_thrift ERROR registering handler, already " "registered: " - << id << std::endl; + << id; throw std::runtime_error(s.str().c_str()); } } if (DEBUG) { - std::cerr << "rpcserver_thrift registering handler: " << id << std::endl; + std::ostringstream msg; + msg << "registering handler: " << id; + GR_LOG_INFO(d_debug_logger, msg.str()); } d_handlercallbackmap.insert(HandlerCallbackMap_t::value_type(id, callback)); } @@ -141,12 +153,14 @@ void rpcserver_thrift::unregisterHandlerCallback(const std::string& id) std::stringstream s; s << "rpcserver_thrift:: rpcserver_thrift ERROR unregistering handler, " "registered: " - << id << std::endl; + << id; throw std::runtime_error(s.str().c_str()); } if (DEBUG) { - std::cerr << "rpcserver_thrift unregistering handler: " << id << std::endl; + std::ostringstream msg; + msg << "unregistering handler: " << id; + GR_LOG_INFO(d_debug_logger, msg.str()); } d_handlercallbackmap.erase(iter); @@ -258,6 +272,8 @@ void rpcserver_thrift::postMessage(const std::string& alias, void rpcserver_thrift::shutdown() { if (DEBUG) { - std::cerr << "Shutting down..." << std::endl; + std::ostringstream msg; + msg << "shutting down... " << id; + GR_LOG_INFO(d_debug_logger, msg.str()); } } |