|
Thunderbots Project
|
#include <network_sink.h>
Public Member Functions | |
| NetworkSink (int robot_id, bool enable_log_merging) | |
| void | replaceUdpSender (std::shared_ptr< ThreadedProtoUdpSender< TbotsProto::RobotLog > > new_sender) |
| void | sendToNetwork (g3::LogMessageMover log_entry) |
| void | sendOneLogToNetwork (const g3::LogMessage &log) |
This class acts as a custom sink for g3log. In particular, it allows us to log to multicast channels from robots
| NetworkSink | ( | int | robot_id, |
| bool | enable_log_merging | ||
| ) |
Creates a NetworkSink that sends UDP packets.
| robot_id | id of the robot sending the logs |
| enable_log_merging | Whether to merge repeated log message or not |
| void replaceUdpSender | ( | std::shared_ptr< ThreadedProtoUdpSender< TbotsProto::RobotLog > > | new_sender | ) |
Replaces the underlying UDP sender with a new one. Intended to be used when a new Full-System node is connected.
| new_sender | the new UDP sender to use |
| void sendOneLogToNetwork | ( | const g3::LogMessage & | log | ) |
Send a single log to the network, without merging.
| log | the LogMessage to send |
| void sendToNetwork | ( | g3::LogMessageMover | log_entry | ) |
This function is called on every call to LOG(). It sends a RobotLog proto on the network and merges repeated messages.
| log_entry | the message received on a LOG() call |