Class: BoringMetrics::LogMethods
- Inherits:
-
Object
- Object
- BoringMetrics::LogMethods
- Defined in:
- lib/boringmetrics/log_methods.rb
Overview
Methods for sending logs
Instance Method Summary collapse
-
#initialize(client) ⇒ LogMethods
constructor
Initialize the logs API.
-
#send(log) ⇒ void
Send a single log event.
-
#send_batch(logs) ⇒ void
Send multiple log events in a batch.
Constructor Details
#initialize(client) ⇒ LogMethods
Initialize the logs API
9 10 11 |
# File 'lib/boringmetrics/log_methods.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#send(log) ⇒ void
This method returns an undefined value.
Send a single log event
23 24 25 |
# File 'lib/boringmetrics/log_methods.rb', line 23 def send(log) @client.add_log(log) end |
#send_batch(logs) ⇒ void
This method returns an undefined value.
Send multiple log events in a batch
31 32 33 |
# File 'lib/boringmetrics/log_methods.rb', line 31 def send_batch(logs) logs.each { |log| send(log) } end |