module Telnyx
Constants
- Conferences
- LEVEL_DEBUG
map to the same values as the standard library's logger
- LEVEL_ERROR
- LEVEL_INFO
- VERSION
Attributes
Public Class Methods
Gets the application for a plugin that's identified some. See set_app_info.
# File lib/telnyx.rb, line 103 def self.app_info @app_info end
# File lib/telnyx.rb, line 107 def self.app_info=(info) @app_info = info end
When set prompts the library to log some extra information to $stdout and $stderr about what it's doing. For example, it'll produce information about requests, responses, and errors that are received. Valid log levels are `debug` and `info`, with `debug` being a little more verbose in places.
Use of this configuration is only useful when `.logger` is not set. When it is, the decision what levels to print is entirely deferred to the logger.
# File lib/telnyx.rb, line 123 def self.log_level @log_level end
# File lib/telnyx.rb, line 127 def self.log_level=(val) # Backwards compatibility for values that we briefly allowed if val == "debug" val = LEVEL_DEBUG elsif val == "info" val = LEVEL_INFO end if !val.nil? && ![LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO].include?(val) raise ArgumentError, "log_level should only be set to `nil`, `debug` or `info`" end @log_level = val end
Sets a logger to which logging output will be sent. The logger should support the same interface as the `Logger` class that's part of Ruby's standard library (hint, anything in `Rails.logger` will likely be suitable).
If `.logger` is set, the value of `.log_level` is ignored. The decision on what levels to print is entirely deferred to the logger.
# File lib/telnyx.rb, line 148 def self.logger @logger end
# File lib/telnyx.rb, line 152 def self.logger=(val) @logger = val end
# File lib/telnyx.rb, line 156 def self.max_network_retries @max_network_retries end
# File lib/telnyx.rb, line 160 def self.max_network_retries=(val) @max_network_retries = val.to_i end
Sets some basic information about the running application that's sent along with API requests. Useful for plugin authors to identify their plugin when communicating with Telnyx
.
Takes a name and optional partner program ID, plugin URL, and version.
# File lib/telnyx.rb, line 169 def self.set_app_info(name, partner_id: nil, url: nil, version: nil) @app_info = { name: name, partner_id: partner_id, url: url, version: version, } end