Class: Bugstack::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bugstack/configuration.rb

Overview

Configuration for the BugStack SDK.

Examples:

Bugstack.init do |config|
  config.api_key = "bs_live_..."
  config.environment = "production"
  config.auto_fix = true
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/bugstack/configuration.rb', line 52

def initialize
  @api_key = ""
  @endpoint = "https://api.bugstack.dev/api/capture"
  @project_id = ""
  @environment = "production"
  @auto_fix = false
  @enabled = true
  @debug = false
  @dry_run = false
  @deduplication_window = 300.0
  @timeout = 5.0
  @max_retries = 3
  @ignored_errors = []
  @before_send = nil
end

Instance Attribute Details

#api_keyString

Returns BugStack API key (required).

Returns:

  • (String)

    BugStack API key (required)



14
15
16
# File 'lib/bugstack/configuration.rb', line 14

def api_key
  @api_key
end

#auto_fixBoolean

Returns Enable autonomous error fixing.

Returns:

  • (Boolean)

    Enable autonomous error fixing



26
27
28
# File 'lib/bugstack/configuration.rb', line 26

def auto_fix
  @auto_fix
end

#before_sendProc?

Returns Hook to inspect/modify/drop events before sending.

Returns:

  • (Proc, nil)

    Hook to inspect/modify/drop events before sending



50
51
52
# File 'lib/bugstack/configuration.rb', line 50

def before_send
  @before_send
end

#debugBoolean

Returns Log SDK activity to console.

Returns:

  • (Boolean)

    Log SDK activity to console



32
33
34
# File 'lib/bugstack/configuration.rb', line 32

def debug
  @debug
end

#deduplication_windowFloat

Returns Deduplication window in seconds.

Returns:

  • (Float)

    Deduplication window in seconds



38
39
40
# File 'lib/bugstack/configuration.rb', line 38

def deduplication_window
  @deduplication_window
end

#dry_runBoolean

Returns Log errors but don’t send them.

Returns:

  • (Boolean)

    Log errors but don’t send them



35
36
37
# File 'lib/bugstack/configuration.rb', line 35

def dry_run
  @dry_run
end

#enabledBoolean

Returns Kill switch — set to false to disable everything.

Returns:

  • (Boolean)

    Kill switch — set to false to disable everything



29
30
31
# File 'lib/bugstack/configuration.rb', line 29

def enabled
  @enabled
end

#endpointString

Returns BugStack API endpoint.

Returns:

  • (String)

    BugStack API endpoint



17
18
19
# File 'lib/bugstack/configuration.rb', line 17

def endpoint
  @endpoint
end

#environmentString

Returns Environment name.

Returns:

  • (String)

    Environment name



23
24
25
# File 'lib/bugstack/configuration.rb', line 23

def environment
  @environment
end

#ignored_errorsArray<Class, String>

Returns Error types or messages to ignore.

Returns:

  • (Array<Class, String>)

    Error types or messages to ignore



47
48
49
# File 'lib/bugstack/configuration.rb', line 47

def ignored_errors
  @ignored_errors
end

#max_retriesInteger

Returns Max retry attempts.

Returns:

  • (Integer)

    Max retry attempts



44
45
46
# File 'lib/bugstack/configuration.rb', line 44

def max_retries
  @max_retries
end

#project_idString

Returns Project identifier.

Returns:

  • (String)

    Project identifier



20
21
22
# File 'lib/bugstack/configuration.rb', line 20

def project_id
  @project_id
end

#timeoutFloat

Returns HTTP timeout in seconds.

Returns:

  • (Float)

    HTTP timeout in seconds



41
42
43
# File 'lib/bugstack/configuration.rb', line 41

def timeout
  @timeout
end