Module: Bugstack
- Defined in:
- lib/bugstack.rb,
lib/bugstack/event.rb,
lib/bugstack/client.rb,
lib/bugstack/version.rb,
lib/bugstack/transport.rb,
lib/bugstack/fingerprint.rb,
lib/bugstack/configuration.rb,
lib/bugstack/integrations/rails.rb,
lib/bugstack/integrations/generic.rb,
lib/bugstack/integrations/sinatra.rb
Overview
BugStack SDK for Ruby — capture, report, and auto-fix production errors.
Usage:
Bugstack.init(api_key: "bs_live_...")
begin
risky_operation
rescue => e
Bugstack.capture_exception(e)
end
Defined Under Namespace
Modules: Fingerprint, Integrations Classes: Client, Configuration, Deduplicator, Error, Event, Transport
Constant Summary collapse
- VERSION =
"1.0.2"
Class Attribute Summary collapse
- .client ⇒ Bugstack::Client? readonly
Class Method Summary collapse
-
.capture_exception(exception, request: nil, metadata: nil) ⇒ Boolean
Capture an exception and send it to BugStack.
-
.init(api_key: nil, **options) {|config| ... } ⇒ Bugstack::Client
Initialize the BugStack SDK.
-
.shutdown ⇒ Object
Flush pending events and shut down.
Class Attribute Details
.client ⇒ Bugstack::Client? (readonly)
25 26 27 |
# File 'lib/bugstack.rb', line 25 def client @client end |
Class Method Details
.capture_exception(exception, request: nil, metadata: nil) ⇒ Boolean
Capture an exception and send it to BugStack.
48 49 50 51 52 53 54 55 |
# File 'lib/bugstack.rb', line 48 def capture_exception(exception, request: nil, metadata: nil) unless @client warn "[BugStack] Not initialized. Call Bugstack.init first." return false end @client.capture_exception(exception, request: request, metadata: ) end |
.init(api_key: nil, **options) {|config| ... } ⇒ Bugstack::Client
Initialize the BugStack SDK.
32 33 34 35 36 37 38 39 40 |
# File 'lib/bugstack.rb', line 32 def init(api_key: nil, **, &block) config = Configuration.new config.api_key = api_key if api_key .each { |k, v| config.public_send(:"#{k}=", v) } yield config if block_given? @client&.shutdown @client = Client.new(config) end |
.shutdown ⇒ Object
Flush pending events and shut down.
58 59 60 61 |
# File 'lib/bugstack.rb', line 58 def shutdown @client&.shutdown @client = nil end |