Class: Onlylogs::HttpLogger
- Inherits:
-
Logger
- Object
- Logger
- Onlylogs::HttpLogger
- Defined in:
- lib/onlylogs/http_logger.rb
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
Returns the value of attribute device.
Instance Method Summary collapse
-
#close ⇒ Object
Only the remote device is ours to close; the local fallback ($stdout) belongs to the app, so we deliberately do not call super (which would close the whole log device, fallback included).
-
#flush ⇒ Object
Drain the device's in-memory queue to the drain now (tests and graceful shutdown rely on it).
-
#initialize(local_fallback: $stdout, **device_options) ⇒ HttpLogger
constructor
A new instance of HttpLogger.
Constructor Details
#initialize(local_fallback: $stdout, **device_options) ⇒ HttpLogger
Returns a new instance of HttpLogger.
18 19 20 21 |
# File 'lib/onlylogs/http_logger.rb', line 18 def initialize(local_fallback: $stdout, **) @device = HttpDevice.new(**) super(MultiDevice.new(local_fallback, @device)) end |
Instance Attribute Details
#device ⇒ Object (readonly)
Returns the value of attribute device.
16 17 18 |
# File 'lib/onlylogs/http_logger.rb', line 16 def device @device end |
Instance Method Details
#close ⇒ Object
Only the remote device is ours to close; the local fallback ($stdout) belongs to the app, so we deliberately do not call super (which would close the whole log device, fallback included).
30 31 32 |
# File 'lib/onlylogs/http_logger.rb', line 30 def close @device.close end |
#flush ⇒ Object
Drain the device's in-memory queue to the drain now (tests and graceful shutdown rely on it).
24 25 26 |
# File 'lib/onlylogs/http_logger.rb', line 24 def flush @device.flush end |