24 #include <rosgraph_msgs/Log.h> 25 #include <unordered_set> 26 #include <std_srvs/Trigger.h> 27 #include <std_srvs/Empty.h> 30 namespace CloudWatchLogs {
39 template<
class UnorderedSet>
40 Options(int8_t severity,
bool publish, UnorderedSet && nodes)
84 void Initialize(
const std::string & log_group,
const std::string & log_stream,
85 const Aws::Client::ClientConfiguration & config, Aws::SDKOptions & sdk_options,
87 const std::shared_ptr<LogServiceFactory>& log_service_factory = std::make_shared<LogServiceFactory>());
89 bool start()
override;
97 void RecordLogs(
const rosgraph_msgs::Log::ConstPtr & log_msg);
114 bool checkIfOnline(std_srvs::Trigger::Request& request, std_srvs::Trigger::Response& response);
118 const std::string
FormatLogs(
const rosgraph_msgs::Log::ConstPtr & log_msg);
~LogNode() override
Tears down a AWSCloudWatchLogNode object.
LogNode(const Options &options)
bool checkIfOnline(std_srvs::Trigger::Request &request, std_srvs::Trigger::Response &response)
const std::string FormatLogs(const rosgraph_msgs::Log::ConstPtr &log_msg)
std::unordered_set< std::string > ignore_nodes_
void TriggerLogPublisher(const ros::TimerEvent &)
Trigger the log manager to call its Service function to publish logs to cloudwatch periodically...
void RecordLogs(const rosgraph_msgs::Log::ConstPtr &log_msg)
Emits RecordLog using the log manager.
bool ShouldSendToCloudWatchLogs(const int8_t log_severity_level)
std::unordered_set< std::string > ignore_nodes
Options(int8_t severity, bool publish, UnorderedSet &&nodes)
std::shared_ptr< Aws::CloudWatchLogs::LogService > log_service_
bool publish_topic_names_
void Initialize(const std::string &log_group, const std::string &log_stream, const Aws::Client::ClientConfiguration &config, Aws::SDKOptions &sdk_options, const Aws::CloudWatchLogs::CloudWatchOptions &cloudwatch_options, const std::shared_ptr< LogServiceFactory > &log_service_factory=std::make_shared< LogServiceFactory >())
Reads creds, region, and SDK option to configure log manager.
LogNode & operator=(const LogNode &other)=delete