18 #include <aws/core/utils/logging/LogMacros.h> 24 namespace CloudWatchLogs {
28 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
29 double & publish_frequency)
34 case Aws::AwsError::AWS_ERR_NOT_FOUND:
36 AWS_LOGSTREAM_INFO(__func__,
37 "Publish frequency configuration not found, setting to default value: " 40 case Aws::AwsError::AWS_ERR_OK:
41 AWS_LOGSTREAM_INFO(__func__,
"Publish frequency is set to: " << publish_frequency);
45 AWS_LOGSTREAM_ERROR(__func__,
46 "Error " << ret <<
" retrieving publish frequency, setting to default value: " 54 std::string & log_group)
58 case Aws::AwsError::AWS_ERR_NOT_FOUND:
60 AWS_LOGSTREAM_INFO(__func__,
61 "Log group name configuration not found, setting to default value: " 64 case Aws::AwsError::AWS_ERR_OK:
65 AWS_LOGSTREAM_INFO(__func__,
"Log group name is set to: " << log_group);
69 AWS_LOGSTREAM_ERROR(__func__,
70 "Error " << ret <<
"retrieving log group name configuration, setting to default value: " 77 std::string & log_stream)
81 case Aws::AwsError::AWS_ERR_NOT_FOUND:
83 AWS_LOGSTREAM_INFO(__func__,
84 "Log stream name configuration not found, setting to default value: " 87 case Aws::AwsError::AWS_ERR_OK:
88 AWS_LOGSTREAM_INFO(__func__,
"Log stream name is set to: " << log_stream);
92 AWS_LOGSTREAM_ERROR(__func__,
93 "Error " << ret <<
"retrieving log stream name configuration, setting to default value: " 100 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
101 bool & subscribe_to_rosout)
106 case Aws::AwsError::AWS_ERR_NOT_FOUND:
110 "Whether to subscribe to rosout_agg topic configuration not found, setting to default value: " 113 case Aws::AwsError::AWS_ERR_OK:
115 __func__,
"Whether to subscribe to rosout_agg topic is set to: " << subscribe_to_rosout);
122 <<
"retrieving parameter for whether to subscribe to rosout_agg topic configuration " 129 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
130 int8_t & min_log_verbosity)
134 std::string specified_verbosity;
138 case Aws::AwsError::AWS_ERR_NOT_FOUND:
139 AWS_LOGSTREAM_INFO(__func__,
"Log verbosity configuration not found, setting to default value: " 142 case Aws::AwsError::AWS_ERR_OK:
143 if (
"DEBUG" == specified_verbosity) {
144 min_log_verbosity = rosgraph_msgs::Log::DEBUG;
145 AWS_LOG_INFO(__func__,
"Log verbosity is set to DEBUG.");
146 }
else if (
"INFO" == specified_verbosity) {
147 min_log_verbosity = rosgraph_msgs::Log::INFO;
148 AWS_LOG_INFO(__func__,
"Log verbosity is set to INFO.");
149 }
else if (
"WARN" == specified_verbosity) {
150 min_log_verbosity = rosgraph_msgs::Log::WARN;
151 AWS_LOG_INFO(__func__,
"Log verbosity is set to WARN.");
152 }
else if (
"ERROR" == specified_verbosity) {
153 min_log_verbosity = rosgraph_msgs::Log::ERROR;
154 AWS_LOG_INFO(__func__,
"Log verbosity is set to ERROR.");
155 }
else if (
"FATAL" == specified_verbosity) {
156 min_log_verbosity = rosgraph_msgs::Log::FATAL;
157 AWS_LOG_INFO(__func__,
"Log verbosity is set to FATAL.");
159 ret = AwsError::AWS_ERR_PARAM;
160 AWS_LOGSTREAM_INFO(__func__,
161 "Log verbosity configuration not valid, setting to default value: " 166 AWS_LOGSTREAM_ERROR(__func__,
167 "Error " << ret <<
" retrieving log verbosity configuration, setting to default value: " 174 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
175 bool & publish_topic_names)
181 case Aws::AwsError::AWS_ERR_NOT_FOUND:
185 "Whether to publish topic names to Cloudwatch Logs configuration not found, setting to default value: " 188 case Aws::AwsError::AWS_ERR_OK:
190 __func__,
"Whether to publish topic names to Cloudwatch Logs is set to: " << publish_topic_names);
197 <<
"retrieving parameter for whether to publish topic names to Cloudwatch Logs" 205 const bool subscribe_to_rosout,
206 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
207 const boost::function<
void(
const rosgraph_msgs::Log::ConstPtr &)>& callback,
209 std::vector<ros::Subscriber> & subscriptions)
211 std::vector<std::string> topics;
214 for (
const std::string& topic : topics) {
216 AWS_LOGSTREAM_INFO(__func__,
"Subscribing to topic: " << topic);
217 subscriptions.push_back(sub);
219 if (subscribe_to_rosout) {
221 AWS_LOG_INFO(__func__,
"Subscribing to rosout_agg");
222 subscriptions.push_back(sub);
228 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
229 std::unordered_set<std::string> & ignore_nodes)
231 std::vector<std::string> ignore_list;
234 case Aws::AwsError::AWS_ERR_NOT_FOUND:
236 case Aws::AwsError::AWS_ERR_OK:
237 for (
const std::string & node_name : ignore_list) {
238 ignore_nodes.emplace(node_name);
242 AWS_LOGSTREAM_ERROR(__func__,
243 "Error " << ret <<
" retrieving retrieving list of nodes to ignore.");
250 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
259 cloudwatch_options = {
261 file_manager_strategy_options
266 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
306 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
347 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
348 const std::string & option_key,
349 const std::string & default_value,
350 std::string & option_value) {
353 case Aws::AwsError::AWS_ERR_NOT_FOUND:
354 option_value = default_value;
355 AWS_LOGSTREAM_INFO(__func__,
356 option_key <<
" parameter not found, setting to default value: " << default_value);
358 case Aws::AwsError::AWS_ERR_OK:
359 AWS_LOGSTREAM_INFO(__func__, option_key <<
" is set to: " << option_value);
362 option_value = default_value;
363 AWS_LOGSTREAM_ERROR(__func__,
364 "Error " << ret <<
" retrieving option " << option_key <<
", setting to default value: " << default_value);
369 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
370 const std::string & option_key,
371 const size_t & default_value,
372 size_t & option_value) {
373 int return_value = 0;
376 case Aws::AwsError::AWS_ERR_NOT_FOUND:
377 option_value = default_value;
378 AWS_LOGSTREAM_INFO(__func__,
379 option_key <<
" parameter not found, setting to default value: " << default_value);
381 case Aws::AwsError::AWS_ERR_OK:
382 option_value =
static_cast<size_t>(return_value);
383 AWS_LOGSTREAM_INFO(__func__, option_key <<
" is set to: " << option_value);
386 option_value = default_value;
387 AWS_LOGSTREAM_ERROR(__func__,
388 "Error " << ret <<
" retrieving option " << option_key <<
", setting to default value: " << default_value);
393 const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
394 const std::string & option_key,
395 const bool & default_value,
400 case Aws::AwsError::AWS_ERR_NOT_FOUND:
401 option_value = default_value;
402 AWS_LOGSTREAM_INFO(__func__,
403 option_key <<
" parameter not found, setting to default value: " << default_value);
405 case Aws::AwsError::AWS_ERR_OK:
406 AWS_LOGSTREAM_INFO(__func__, option_key <<
" is set to: " << option_value);
409 option_value = default_value;
410 AWS_LOGSTREAM_ERROR(__func__,
411 "Error " << ret <<
" retrieving option " << option_key <<
", setting to default value: " << default_value);
std::string file_extension
constexpr int kNodeSubQueueSize
Aws::AwsError ReadIgnoreNodesSet(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, std::unordered_set< std::string > &ignore_nodes)
size_t batch_max_queue_size
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
size_t batch_trigger_publish_size
Aws::AwsError ReadSubscribeToRosout(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, bool &subscribe_to_rosout)
size_t file_upload_batch_size
Aws::AwsError ReadMinLogVerbosity(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, int8_t &min_log_verbosity)
Aws::AwsError ReadPublishFrequency(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, double &publish_frequency)
Aws::AwsError ReadSubscriberList(bool subscribe_to_rosout, const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, const boost::function< void(const rosgraph_msgs::Log::ConstPtr &)> &callback, ros::NodeHandle &nh, std::vector< ros::Subscriber > &subscriptions)
void ReadFileManagerStrategyOptions(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, Aws::FileManagement::FileManagerStrategyOptions &file_manager_strategy_options)
constexpr char kNodeParamFileMaxQueueSize[]
size_t storage_limit_in_kb
static constexpr UploaderOptions kDefaultUploaderOptions
size_t maximum_file_size_in_kb
constexpr char kNodeParamMinLogVerbosityKey[]
constexpr char kNodeParamPublishFrequencyKey[]
constexpr int8_t kNodeMinLogVerbosityDefaultValue
size_t stream_max_queue_size
constexpr char kNodeParamSubscribeToRosoutKey[]
static const FileManagerStrategyOptions kDefaultFileManagerStrategyOptions
constexpr char kNodeParamFilePrefix[]
void ReadUploaderOptions(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, Aws::DataFlow::UploaderOptions &uploader_options)
Aws::AwsError ReadLogStream(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, std::string &log_stream)
constexpr bool kNodeSubscribeToRosoutDefaultValue
Aws::AwsError ReadPublishTopicNames(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, bool &publish_topic_names)
constexpr char kNodeRosoutAggregatedTopicName[]
constexpr char kNodeParamBatchTriggerPublishSize[]
constexpr bool kNodePublishTopicNamesDefaultValue
constexpr double kNodePublishFrequencyDefaultValue
Aws::AwsError ReadLogGroup(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, std::string &log_group)
constexpr char kNodeParamBatchMaxQueueSize[]
constexpr char kNodeParamLogGroupNameKey[]
constexpr char kNodeParamDeleteStaleData[]
void ReadCloudWatchOptions(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, Aws::CloudWatchLogs::CloudWatchOptions &cloudwatch_options)
constexpr char kNodeParamPublishTopicNamesKey[]
constexpr char kNodeLogStreamNameDefaultValue[]
constexpr char kNodeParamMaximumFileSize[]
constexpr char kNodeParamLogTopicsListKey[]
constexpr char kNodeParamIgnoreNodesKey[]
std::string storage_directory
size_t file_max_queue_size
void ReadOption(const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meter_reader, const std::string &option_key, const std::string &default_value, std::string &option_value)
constexpr char kNodeParamFileExtension[]
constexpr char kNodeParamLogStreamNameKey[]
constexpr char kNodeParamStorageLimit[]
constexpr char kNodeParamFileUploadBatchSize[]
constexpr char kNodeParamStreamMaxQueueSize[]
constexpr char kNodeLogGroupNameDefaultValue[]
constexpr char kNodeParamStorageDirectory[]