Class: Logging::Appenders::Flowdock
- Inherits:
-
Logging::Appender
- Object
- Logging::Appender
- Logging::Appenders::Flowdock
- Includes:
- Buffering
- Defined in:
- lib/logging/appenders/flowdock.rb
Overview
This class provides an Appender that can write to a Flowdock service over UDP.
Constant Summary collapse
- DEFAULT_OPTS =
We use a background flusher instead, as the connection to Flowdock can be quite slow:
{ flush_period: 1, }
Instance Attribute Summary collapse
-
#api_token ⇒ Object
readonly
Returns the value of attribute api_token.
-
#flow ⇒ Object
readonly
Returns the value of attribute flow.
-
#flow_user ⇒ Object
readonly
Returns the value of attribute flow_user.
Instance Method Summary collapse
- #close(*args) ⇒ Object
-
#initialize(name, opts = {}) ⇒ Flowdock
constructor
Creates a new Flowdock Appender that will use the given host and port as the Flowdock server destination.
Constructor Details
#initialize(name, opts = {}) ⇒ Flowdock
Creates a new Flowdock Appender that will use the given host and port as the Flowdock server destination.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/logging/appenders/flowdock.rb', line 27 def initialize(name, opts = {}) @api_token = opts[:api_token] @flow_user = opts[:flow_user] fail ArgumentError, 'Empty api_token and flow_user is not appropriate' unless api_token && !api_token.empty? && flow_user && !flow_user.empty? # Initialise flow var: flow super configure_buffering(DEFAULT_OPTS.merge(opts)) end |
Instance Attribute Details
#api_token ⇒ Object (readonly)
Returns the value of attribute api_token.
19 20 21 |
# File 'lib/logging/appenders/flowdock.rb', line 19 def api_token @api_token end |
#flow ⇒ Object (readonly)
Returns the value of attribute flow.
19 20 21 |
# File 'lib/logging/appenders/flowdock.rb', line 19 def flow @flow end |
#flow_user ⇒ Object (readonly)
Returns the value of attribute flow_user.
19 20 21 |
# File 'lib/logging/appenders/flowdock.rb', line 19 def flow_user @flow_user end |
Instance Method Details
#close(*args) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/logging/appenders/flowdock.rb', line 44 def close(*args) super @flow = nil self end |