From 91282c4337b2dd22eb19dc22804d2b5324a853d6 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Wed, 25 May 2022 15:56:33 -0700 Subject: [PATCH] Migrate `igndbg` -> `gzdbg` Signed-off-by: methylDragon --- plugins/gazebo_factory/GazeboFactory.cc | 2 +- plugins/gazebo_gui/GazeboGui.cc | 2 +- plugins/gazebo_server/GazeboServer.cc | 2 +- plugins/joy_to_twist/JoyToTwist.cc | 2 +- plugins/joystick/Joystick.cc | 2 +- plugins/websocket_server/WebsocketServer.cc | 50 ++++++++++----------- src/Manager.cc | 24 +++++----- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/plugins/gazebo_factory/GazeboFactory.cc b/plugins/gazebo_factory/GazeboFactory.cc index ff76abe0..519230c2 100644 --- a/plugins/gazebo_factory/GazeboFactory.cc +++ b/plugins/gazebo_factory/GazeboFactory.cc @@ -162,7 +162,7 @@ bool GazeboFactory::Load(const tinyxml2::XMLElement *_elem) if (executed && result && rep.data()) { - igndbg << "Factory service call succeeded.\n"; + gzdbg << "Factory service call succeeded.\n"; if (!this->worldPerformers[msg.first].empty()) { IGN_SLEEP_S(2); diff --git a/plugins/gazebo_gui/GazeboGui.cc b/plugins/gazebo_gui/GazeboGui.cc index 3aa19e6b..84f48617 100644 --- a/plugins/gazebo_gui/GazeboGui.cc +++ b/plugins/gazebo_gui/GazeboGui.cc @@ -139,7 +139,7 @@ bool GazeboGui::Load(const tinyxml2::XMLElement *_elem) app->LoadPlugin(file, elem); } - igndbg << "Running the GazeboGui plugin.\n"; + gzdbg << "Running the GazeboGui plugin.\n"; // This blocks until the window is closed or we receive a SIGINT app->exec(); diff --git a/plugins/gazebo_server/GazeboServer.cc b/plugins/gazebo_server/GazeboServer.cc index dcc56175..a26d8a7c 100644 --- a/plugins/gazebo_server/GazeboServer.cc +++ b/plugins/gazebo_server/GazeboServer.cc @@ -347,6 +347,6 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) this->server.reset(new sim::Server(serverConfig)); this->server->Run(false, 0, !run); - igndbg << "Loaded GazeboServer plugin.\n"; + gzdbg << "Loaded GazeboServer plugin.\n"; return true; } diff --git a/plugins/joy_to_twist/JoyToTwist.cc b/plugins/joy_to_twist/JoyToTwist.cc index 54abcc13..17aa68c8 100644 --- a/plugins/joy_to_twist/JoyToTwist.cc +++ b/plugins/joy_to_twist/JoyToTwist.cc @@ -109,7 +109,7 @@ bool JoyToTwist::Load(const tinyxml2::XMLElement *_elem) this->cmdVelPub = this->node.Advertise( this->outputTopic); - igndbg << "Loaded JoyToTwist plugin with the following parameters:\n" + gzdbg << "Loaded JoyToTwist plugin with the following parameters:\n" << " input_topic: " << this->inputTopic << std::endl << " output_topic: " << this->outputTopic << std::endl; this->running = true; diff --git a/plugins/joystick/Joystick.cc b/plugins/joystick/Joystick.cc index 310385f1..3b8723f3 100644 --- a/plugins/joystick/Joystick.cc +++ b/plugins/joystick/Joystick.cc @@ -173,7 +173,7 @@ bool Joystick::Load(const tinyxml2::XMLElement *_elem) this->run = true; this->joyThread = new std::thread(std::bind(&Joystick::Run, this)); - igndbg << "Loaded Joystick plugin with the following parameters:\n" + gzdbg << "Loaded Joystick plugin with the following parameters:\n" << " device: " << deviceFilename << std::endl << " sticky_buttons: " << this->stickyButtons << std::endl << " dead_zone: " << deadzone << std::endl diff --git a/plugins/websocket_server/WebsocketServer.cc b/plugins/websocket_server/WebsocketServer.cc index 108ab5f4..cdecdb40 100644 --- a/plugins/websocket_server/WebsocketServer.cc +++ b/plugins/websocket_server/WebsocketServer.cc @@ -143,13 +143,13 @@ int httpCallback(struct lws *_wsi, case LWS_CALLBACK_HTTP: { char *URI = (char *) _in; - igndbg << "Requested URI: " << URI << "\n"; + gzdbg << "Requested URI: " << URI << "\n"; // Router // Server metrics if (strcmp(URI, "/metrics") == 0) { - igndbg << "Handling /metrics\n"; + gzdbg << "Handling /metrics\n"; // TODO Support a proper way to output metrics @@ -188,7 +188,7 @@ int httpCallback(struct lws *_wsi, // Return a 404 if no route was matched else { - igndbg << "Resource not found.\n"; + gzdbg << "Resource not found.\n"; lws_return_http_status(_wsi, HTTP_STATUS_NOT_FOUND, "Not Found"); } break; @@ -232,7 +232,7 @@ int rootCallback(struct lws *_wsi, { // Open connections. case LWS_CALLBACK_ESTABLISHED: - igndbg << "LWS_CALLBACK_ESTABLISHED\n"; + gzdbg << "LWS_CALLBACK_ESTABLISHED\n"; self->OnConnect(fd); // This will generate a LWS_CALLBACK_SERVER_WRITEABLE event when the // connection is writable. @@ -241,12 +241,12 @@ int rootCallback(struct lws *_wsi, // Close connections. case LWS_CALLBACK_CLOSED: - igndbg << "LWS_CALLBACK_CLOSED\n"; + gzdbg << "LWS_CALLBACK_CLOSED\n"; self->OnDisconnect(fd); break; case LWS_CALLBACK_HTTP: - igndbg << "LWS_CALLBACK_HTTP\n"; + gzdbg << "LWS_CALLBACK_HTTP\n"; return httpCallback(_wsi, _reason, _user, _in, _len); break; @@ -286,7 +286,7 @@ int rootCallback(struct lws *_wsi, // Handle incoming messages case LWS_CALLBACK_RECEIVE: - igndbg << "LWS_CALLBACK_RECEIVE\n"; + gzdbg << "LWS_CALLBACK_RECEIVE\n"; // Prevent too many connections. if (self->maxConnections >= 0 && @@ -398,7 +398,7 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) << std::endl; } } - igndbg << "Using port[" << port << "]\n"; + gzdbg << "Using port[" << port << "]\n"; // Get the maximum connection count, if present. elem = _elem->FirstChildElement("max_connections"); @@ -413,7 +413,7 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) gzerr << "Failed to convert max_connections[" << elem->GetText() << "] to integer." << std::endl; } - igndbg << "Using maximum connection count of " + gzdbg << "Using maximum connection count of " << this->maxConnections << std::endl; } @@ -432,7 +432,7 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) gzerr << "Failed to parse queue_size_per_connection[" << elem->GetText() << "]." << std::endl; } - igndbg << "Using connection msg queue size of " + gzdbg << "Using connection msg queue size of " << this->queueSizePerConnection << std::endl; } @@ -453,7 +453,7 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) if (result == tinyxml2::XML_SUCCESS && limit >= 0) { this->msgTypeSubscriptionLimit[msgType] = limit; - igndbg << "Setting msg type subscription limit[" << msgType + gzdbg << "Setting msg type subscription limit[" << msgType << ", " << limit << "]" << std::endl; } else @@ -694,7 +694,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) key == this->adminAuthorizationKey; } - igndbg << "Authorization request received on socket[" << _socketId << "]. " + gzdbg << "Authorization request received on socket[" << _socketId << "]. " << "Authorized[" << this->connections[_socketId]->authorized << "]\n"; std::string result = @@ -706,14 +706,14 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) if (!this->connections[_socketId]->authorized) { - igndbg << "Unauthorized request received on socket[" << _socketId << "]\n"; + gzdbg << "Unauthorized request received on socket[" << _socketId << "]\n"; return; } // Handle the case where the client requests the message definitions. if (frameParts[0] == "protos") { - igndbg << "Protos request received\n"; + gzdbg << "Protos request received\n"; std::string allProtos = "syntax = \"proto3\";\n"; allProtos += "package gz.msgs;\n"; @@ -747,7 +747,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "topics") { - igndbg << "Topic list request recieved\n"; + gzdbg << "Topic list request recieved\n"; gz::msgs::StringMsg_V msg; std::vector topics; @@ -768,7 +768,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "topics-types") { - igndbg << "Topic and message type list request recieved\n"; + gzdbg << "Topic and message type list request recieved\n"; gz::msgs::Publishers msg; std::vector topics; @@ -798,7 +798,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "worlds") { - igndbg << "World info request recieved\n"; + gzdbg << "World info request recieved\n"; gz::msgs::Empty req; req.set_unused(true); @@ -818,7 +818,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "scene") { - igndbg << "Scene info request recieved for world[" + gzdbg << "Scene info request recieved for world[" << frameParts[1] << "]\n"; gz::msgs::Empty req; req.set_unused(true); @@ -848,7 +848,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) /// to rely on the "scene" message. else if (frameParts[0] == "particle_emitters") { - igndbg << "Particle emitter request received for world[" + gzdbg << "Particle emitter request received for world[" << frameParts[1] << "]\n"; gz::msgs::Empty req; req.set_unused(true); @@ -888,7 +888,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) this->topicTimestamps[topic] = std::chrono::steady_clock::now() - this->publishPeriod; - igndbg << "Subscribe request to topic[" << frameParts[1] << "]\n"; + gzdbg << "Subscribe request to topic[" << frameParts[1] << "]\n"; this->node.SubscribeRaw(topic, std::bind(&WebsocketServer::OnWebsocketSubscribedMessage, this, std::placeholders::_1, @@ -926,12 +926,12 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) if (!imageTopics.count(topic)) { - igndbg << "Could not find topic: " << topic << " to stream" + gzdbg << "Could not find topic: " << topic << " to stream" << std::endl; return; } - igndbg << "Subscribe request to image topic[" << frameParts[1] << "]\n"; + gzdbg << "Subscribe request to image topic[" << frameParts[1] << "]\n"; this->node.Subscribe(frameParts[1], &WebsocketServer::OnWebsocketSubscribedImageMessage, this); } @@ -939,7 +939,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) { std::string topic = frameParts[1]; - igndbg << "Unsubscribe request for topic[" << topic << "]\n"; + gzdbg << "Unsubscribe request for topic[" << topic << "]\n"; std::map>::iterator topicConnectionIter = this->topicConnections.find(topic); @@ -960,7 +960,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) // more websocket connections. if (topicConnectionIter->second.empty()) { - igndbg << "Unsubscribing from Gazebo Transport Topic[" + gzdbg << "Unsubscribing from Gazebo Transport Topic[" << frameParts[1] << "]\n"; this->node.Unsubscribe(frameParts[1]); } @@ -974,7 +974,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) else if (frameParts[0] == "throttle") { std::string topic = frameParts[1]; - igndbg << "Throttle request for topic[" << topic << "]\n"; + gzdbg << "Throttle request for topic[" << topic << "]\n"; if (!topic.empty()) { try diff --git a/src/Manager.cc b/src/Manager.cc index 848471d3..28a81580 100644 --- a/src/Manager.cc +++ b/src/Manager.cc @@ -497,7 +497,7 @@ bool ManagerPrivate::Stop() ///////////////////////////////////////////////// void ManagerPrivate::OnSigIntTerm(int _sig) { - igndbg << "OnSigIntTerm Received signal[" << _sig << "]\n"; + gzdbg << "OnSigIntTerm Received signal[" << _sig << "]\n"; this->Stop(); } @@ -578,7 +578,7 @@ void ManagerPrivate::RestartLoop() { if (iter->pid == p) { - igndbg << "Death of process[" << p << "] with name[" + gzdbg << "Death of process[" << p << "] with name[" << iter->name << "].\n"; // Restart if autoRestart is enabled @@ -592,7 +592,7 @@ void ManagerPrivate::RestartLoop() if (!restartExec.name.empty() && !restartExec.command.empty()) { - igndbg << "Restarting process with name[" << restartExec.name << "]\n"; + gzdbg << "Restarting process with name[" << restartExec.name << "]\n"; this->RunExecutable(restartExec); } @@ -639,7 +639,7 @@ void ManagerPrivate::RestartLoop() { if (iter->pi == p) { - igndbg << "Death of process[" << p << "] with name [" + gzdbg << "Death of process[" << p << "] with name [" << iter->name << "].\n"; // Restart if autoRestart is enabled @@ -653,7 +653,7 @@ void ManagerPrivate::RestartLoop() if (!restartExec.name.empty() && !restartExec.command.empty()) { - igndbg << "Restarting process with name[" << restartExec.name << "]\n"; + gzdbg << "Restarting process with name[" << restartExec.name << "]\n"; this->RunExecutable(restartExec); } @@ -815,7 +815,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, // If parent process... if (pid) { - igndbg << "Forked a process for [" << _name << "] command[" + gzdbg << "Forked a process for [" << _name << "] command[" << std::accumulate(_cmd.begin(), _cmd.end(), std::string("")) << "]\n" << std::flush; @@ -909,7 +909,7 @@ void ManagerPrivate::ShutdownExecutables() // Shutdown the processes for (const Executable &exec : this->executables) { - igndbg << "Killing the process[" << exec.name + gzdbg << "Killing the process[" << exec.name #ifndef _WIN32 << "] with PID[" << exec.pid << "]\n"; kill(exec.pid, SIGINT); @@ -926,20 +926,20 @@ void ManagerPrivate::ShutdownExecutables() #endif { #ifndef _WIN32 - igndbg << "Killing the wrapped plugin PID[" << pid << "]\n"; + gzdbg << "Killing the wrapped plugin PID[" << pid << "]\n"; kill(pid, SIGINT); #else - igndbg << "Killing the wrapped plugin PID[" << pid.dwProcessId << "]\n"; + gzdbg << "Killing the wrapped plugin PID[" << pid.dwProcessId << "]\n"; TerminateProcess(pid.hProcess, 0); #endif } - igndbg << "Waiting for each process to end\n"; + gzdbg << "Waiting for each process to end\n"; // Wait for all the monitors to stop for (std::thread &m : monitors) m.join(); - igndbg << "All finished\n"; + gzdbg << "All finished\n"; } ////////////////////////////////////////////////// @@ -1134,7 +1134,7 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) return; } - igndbg << "Loading plugin. Name[" << name + gzdbg << "Loading plugin. Name[" << name << "] File[" << file << "]" << std::endl; PluginPtr plugin = loader.Instantiate(name);