From c9375a1ee264d69e13ca6dfc450259a8d6ff9e78 Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Wed, 7 Mar 2012 19:25:47 -0600 Subject: [PATCH] Add source code module name to stdout/stderr messages to improve readability. --- mcop/dispatcher.cc | 26 +++++++++++++------------- soundserver/artsd.cc | 10 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mcop/dispatcher.cc b/mcop/dispatcher.cc index 7a2f0cf..8250a02 100644 --- a/mcop/dispatcher.cc +++ b/mcop/dispatcher.cc @@ -183,7 +183,7 @@ Dispatcher::Dispatcher(IOManager *ioManager, StartServer startServer) if(!unixServer->running()) { delete unixServer; - arts_warning("MCOP: couldn't start UnixServer"); + arts_warning("[mcop dispatcher] Couldn't start UnixServer"); unixServer = 0; } } @@ -195,7 +195,7 @@ Dispatcher::Dispatcher(IOManager *ioManager, StartServer startServer) if(!tcpServer->running()) { delete tcpServer; - arts_warning("MCOP: couldn't start TCPServer"); + arts_warning("[mcop dispatcher] Couldn't start TCPServer"); tcpServer = 0; } } @@ -216,7 +216,7 @@ Dispatcher::Dispatcher(IOManager *ioManager, StartServer startServer) orig_sigpipe = signal(SIGPIPE,SIG_IGN); if((orig_sigpipe != SIG_DFL) && (orig_sigpipe != SIG_IGN)) { - cerr << "mcop warning: user defined signal handler found for" + cerr << "[mcop dispatcher] warning: user defined signal handler found for" " SIG_PIPE, overriding" << endl; } @@ -283,7 +283,7 @@ Dispatcher::Dispatcher(IOManager *ioManager, StartServer startServer) * happen. In this case, we will remove the cookie and overwrite it * with our previously generated cookie. */ - arts_warning("bad md5 secret-cookie obtained from %s - replacing it", + arts_warning("[mcop dispatcher] Bad md5 secret-cookie obtained from %s - replacing it", globalComm()._interfaceName().c_str()); globalComm().erase("secret-cookie"); @@ -390,7 +390,7 @@ Dispatcher::~Dispatcher() if(Object_base::_objectCount()) { - cerr << "warning: leaving MCOP Dispatcher and still " + cerr << "[mcop dispatcher] warning: leaving MCOP Dispatcher and still " << Object_base::_objectCount() << " object references alive." << endl; list which = objectPool.enumerate(); list::iterator i; @@ -400,13 +400,13 @@ Dispatcher::~Dispatcher() if(Type::_typeCount()) { - cerr << "warning: leaving MCOP Dispatcher and still " + cerr << "[mcop dispatcher] warning: leaving MCOP Dispatcher and still " << Type::_typeCount() << " types alive." << endl; } if(GenericDataPacket::_dataPacketCount()) { - cerr << "warning: leaving MCOP Dispatcher and still " + cerr << "[mcop dispatcher] warning: leaving MCOP Dispatcher and still " << GenericDataPacket::_dataPacketCount() << " data packets alive." << endl; } @@ -692,7 +692,7 @@ void Dispatcher::handle(Connection *conn, Buffer *buffer, long messageType) } else { - cerr << "MCOP error: don't know authentication protocol" << endl; + cerr << "[mcop dispatcher] error: don't know authentication protocol" << endl; cerr << " server offered: "; for(ai = h.authProtocols.begin(); ai != h.authProtocols.end(); ai++) cerr << *ai << " "; @@ -775,11 +775,11 @@ void Dispatcher::handle(Connection *conn, Buffer *buffer, long messageType) /* * We shouldn't reach this point if everything went all right */ - cerr << "Fatal communication error with a client" << endl; + cerr << "[mcop dispatcher] Fatal communication error with a client" << endl; if(conn->connState() != Connection::established) { - cerr << " Authentication of this client was not successful" << endl; - cerr << " Connection dropped" << endl; + cerr << "[mcop dispatcher] Authentication of this client was not successful" << endl; + cerr << "[mcop dispatcher] Connection dropped" << endl; conn->drop(); } } @@ -996,14 +996,14 @@ void Dispatcher::handleCorrupt(Connection *connection) { if(connection->connState() != Connection::established) { - cerr << "received corrupt message on unauthenticated connection" <drop(); d->serverConnectCondition.wakeAll(); } else { - cerr << "WARNING: got corrupt MCOP message !??" << endl; + cerr << "[mcop dispatcher] warning: got corrupt MCOP message !??" << endl; } } diff --git a/soundserver/artsd.cc b/soundserver/artsd.cc index cbe5525..ffd2f2b 100644 --- a/soundserver/artsd.cc +++ b/soundserver/artsd.cc @@ -205,7 +205,7 @@ static bool publishReferences(SoundServerV2 server, if(!result && !silent) { cerr << -"Error: Can't add object reference (probably artsd is already running)." +"[artsd] Error: Can't add object reference (probably artsd is already running)." << endl << " If you are sure it is not already running, remove the relevant files:" << endl << endl << @@ -235,7 +235,7 @@ static void cleanUnusedReferences() { int i = 0; - cerr << "There are already artsd objects registered, " + cerr << "[artsd] There are already artsd objects registered, " "looking if they are active..." << endl; sleep(1); // maybe an artsd process has just started (give it some time) @@ -247,7 +247,7 @@ static void cleanUnusedReferences() i += cleanReference("Arts_AudioManager"); if(i) - cerr << "... cleaned " <