Class: CWlogsIO::IO
- Inherits:
-
Object
- Object
- CWlogsIO::IO
- Defined in:
- lib/cwlogs_io/io.rb
Overview
ruby ‘logger’ compatible IO-like class. it should implement #write, #close method. github.com/ruby/logger/blob/master/lib/logger/log_device.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(auth, log_group, log_stream) ⇒ IO
constructor
A new instance of IO.
- #write(message) ⇒ Object
Constructor Details
#initialize(auth, log_group, log_stream) ⇒ IO
Returns a new instance of IO.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/cwlogs_io/io.rb', line 50 def initialize(auth, log_group, log_stream) @auth = auth @log_group = log_group @log_stream = log_stream @handler = HandlerWrapper.create(LogEventHandler, client, log_group, log_stream, logger) close if !ensure_log_group || !ensure_log_stream at_exit do close end end |