log_node_param_helper.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #pragma once
17 
21 #include <ros/ros.h>
22 #include <rosgraph_msgs/Log.h>
23 #include <unordered_set>
24 
25 namespace Aws {
26 namespace CloudWatchLogs {
27 namespace Utils {
28 
29 constexpr int kNodeSubQueueSize = 100;
30 constexpr char kNodeRosoutAggregatedTopicName[] = "rosout_agg";
31 
32 constexpr char kNodeParamLogStreamNameKey[] = "log_stream_name";
33 constexpr char kNodeParamPublishFrequencyKey[] = "publish_frequency";
34 constexpr char kNodeParamSubscribeToRosoutKey[] = "sub_to_rosout";
35 constexpr char kNodeParamLogGroupNameKey[] = "log_group_name";
36 constexpr char kNodeParamLogTopicsListKey[] = "topics";
37 constexpr char kNodeParamMinLogVerbosityKey[] = "min_log_verbosity";
38 constexpr char kNodeParamPublishTopicNamesKey[] = "publish_topic_names";
39 constexpr char kNodeParamIgnoreNodesKey[] = "ignore_nodes";
40 
42 constexpr char kNodeParamFileUploadBatchSize[] = "file_upload_batch_size";
43 constexpr char kNodeParamFileMaxQueueSize[] = "file_max_queue_size";
44 constexpr char kNodeParamBatchMaxQueueSize[] = "batch_max_queue_size";
45 constexpr char kNodeParamBatchTriggerPublishSize[] = "batch_trigger_publish_size";
46 constexpr char kNodeParamStreamMaxQueueSize[] = "stream_max_queue_size";
47 
49 constexpr char kNodeParamFilePrefix[] = "file_prefix";
50 constexpr char kNodeParamStorageDirectory[] = "storage_directory";
51 constexpr char kNodeParamFileExtension[] = "file_extension";
52 constexpr char kNodeParamMaximumFileSize[] = "maximum_file_size";
53 constexpr char kNodeParamStorageLimit[] = "storage_limit";
54 constexpr char kNodeParamDeleteStaleData[] = "delete_stale_data";
55 
57 constexpr char kNodeLogGroupNameDefaultValue[] = "ros_log_group";
58 constexpr char kNodeLogStreamNameDefaultValue[] = "ros_log_stream";
59 constexpr int8_t kNodeMinLogVerbosityDefaultValue = rosgraph_msgs::Log::DEBUG;
60 constexpr double kNodePublishFrequencyDefaultValue = 5.0;
61 constexpr bool kNodeSubscribeToRosoutDefaultValue = true;
62 constexpr bool kNodePublishTopicNamesDefaultValue = true;
63 
73  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
74  double & publish_frequency);
75 
84 Aws::AwsError ReadLogGroup(const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
85  std::string & log_group);
86 
95 Aws::AwsError ReadLogStream(const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
96  std::string & log_stream);
97 
107  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
108  bool & subscribe_to_rosout);
109 
120  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
121  int8_t & min_log_verbosity);
122 
133  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
134  bool & publish_topic_names);
135 
149  bool subscribe_to_rosout,
150  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
151  const boost::function<void(const rosgraph_msgs::Log::ConstPtr &)>& callback,
152  ros::NodeHandle & nh,
153  std::vector<ros::Subscriber> & subscriptions);
154 
164  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
165  std::unordered_set<std::string> & ignore_nodes);
166 
176  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
177  Aws::CloudWatchLogs::CloudWatchOptions & cloudwatch_options);
178 
188  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
189  Aws::DataFlow::UploaderOptions & uploader_options);
190 
200  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
201  Aws::FileManagement::FileManagerStrategyOptions & file_manager_strategy_options);
202 
213 void ReadOption(
214  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
215  const std::string & option_key,
216  const std::string & default_value,
217  std::string & option_value);
218 
229 void ReadOption(
230  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
231  const std::string & option_key,
232  const size_t & default_value,
233  size_t & option_value);
234 
245 void ReadOption(
246  const std::shared_ptr<Aws::Client::ParameterReaderInterface>& parameter_reader,
247  const std::string & option_key,
248  const bool & default_value,
249  bool & option_value);
250 
251 } // namespace Utils
252 } // namespace CloudWatchLogs
253 } // namespace Aws
Aws::AwsError ReadIgnoreNodesSet(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_reader, std::unordered_set< std::string > &ignore_nodes)
Aws::AwsError ReadSubscribeToRosout(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_reader, bool &subscribe_to_rosout)
Aws::AwsError ReadMinLogVerbosity(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_reader, int8_t &min_log_verbosity)
Aws::AwsError ReadPublishFrequency(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_reader, double &publish_frequency)
Aws::AwsError ReadSubscriberList(bool subscribe_to_rosout, const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_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 > &parameter_reader, Aws::FileManagement::FileManagerStrategyOptions &file_manager_strategy_options)
constexpr char kNodeParamFileMaxQueueSize[]
constexpr char kNodeParamMinLogVerbosityKey[]
constexpr char kNodeParamPublishFrequencyKey[]
constexpr int8_t kNodeMinLogVerbosityDefaultValue
constexpr char kNodeParamSubscribeToRosoutKey[]
void ReadUploaderOptions(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_reader, Aws::DataFlow::UploaderOptions &uploader_options)
Aws::AwsError ReadLogStream(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_reader, std::string &log_stream)
constexpr bool kNodeSubscribeToRosoutDefaultValue
Aws::AwsError ReadPublishTopicNames(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_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 > &parameter_reader, std::string &log_group)
constexpr char kNodeParamBatchMaxQueueSize[]
constexpr char kNodeParamLogGroupNameKey[]
constexpr char kNodeParamDeleteStaleData[]
void ReadCloudWatchOptions(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_reader, Aws::CloudWatchLogs::CloudWatchOptions &cloudwatch_options)
constexpr char kNodeParamPublishTopicNamesKey[]
constexpr char kNodeLogStreamNameDefaultValue[]
constexpr char kNodeParamMaximumFileSize[]
constexpr char kNodeParamLogTopicsListKey[]
constexpr char kNodeParamIgnoreNodesKey[]
void ReadOption(const std::shared_ptr< Aws::Client::ParameterReaderInterface > &parameter_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[]


cloudwatch_logger
Author(s): AWS RoboMaker
autogenerated on Sat Mar 6 2021 03:55:46