Class: Meteorlog::Wrapper::LogStreamCollection
- Inherits:
-
Object
- Object
- Meteorlog::Wrapper::LogStreamCollection
- Extended by:
- Forwardable
- Includes:
- Logger::Helper
- Defined in:
- lib/meteorlog/wrapper/log_stream_collection.rb
Instance Method Summary collapse
- #create(name, opts = {}) ⇒ Object
- #each ⇒ Object
-
#initialize(cloud_watch_logs, log_streams, log_group, options = {}) ⇒ LogStreamCollection
constructor
A new instance of LogStreamCollection.
Methods included from Logger::Helper
Constructor Details
#initialize(cloud_watch_logs, log_streams, log_group, options = {}) ⇒ LogStreamCollection
Returns a new instance of LogStreamCollection.
7 8 9 10 11 12 |
# File 'lib/meteorlog/wrapper/log_stream_collection.rb', line 7 def initialize(cloud_watch_logs, log_streams, log_group, = {}) @cloud_watch_logs = cloud_watch_logs @log_streams = log_streams @log_group = log_group @options = end |
Instance Method Details
#create(name, opts = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/meteorlog/wrapper/log_stream_collection.rb', line 21 def create(name, opts = {}) log(:info, 'Create LogStream', :cyan, "#{self.log_group_name} > #{name}") unless @options[:dry_run] @cloud_watch_logs.create_log_stream( :log_group_name => self.log_group_name, :log_stream_name => name) @options[:modified] = true end log_stream = OpenStruct.new(:log_stream_name => name) Meteorlog::Wrapper::LogStream.new( @cloud_watch_logs, log_stream, @log_group, @options) end |