Class: Meteorlog::Wrapper::LogGroupCollection
- Inherits:
-
Object
- Object
- Meteorlog::Wrapper::LogGroupCollection
- Includes:
- Logger::Helper
- Defined in:
- lib/meteorlog/wrapper/log_group_collection.rb
Instance Method Summary collapse
- #create(name, opts = {}) ⇒ Object
- #each ⇒ Object
-
#initialize(cloud_watch_logs, log_groups, options = {}) ⇒ LogGroupCollection
constructor
A new instance of LogGroupCollection.
Methods included from Logger::Helper
Constructor Details
#initialize(cloud_watch_logs, log_groups, options = {}) ⇒ LogGroupCollection
Returns a new instance of LogGroupCollection.
4 5 6 7 8 |
# File 'lib/meteorlog/wrapper/log_group_collection.rb', line 4 def initialize(cloud_watch_logs, log_groups, = {}) @cloud_watch_logs = cloud_watch_logs @log_groups = log_groups @options = end |
Instance Method Details
#create(name, opts = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/meteorlog/wrapper/log_group_collection.rb', line 17 def create(name, opts = {}) log(:info, 'Create LogGroup', :cyan, name) unless @options[:dry_run] @cloud_watch_logs.create_log_group(:log_group_name => name) @options[:modified] = true end log_group = OpenStruct.new( :log_group_name => name, :log_streams => [], :metric_filters => []) Meteorlog::Wrapper::LogGroup.new( @cloud_watch_logs, log_group, @options) end |