Module: Crashdesk

Defined in:
lib/crashdesk.rb,
lib/crashdesk/version.rb,
lib/crashdesk/crashlog.rb,
lib/crashdesk/backtrace.rb,
lib/crashdesk/environment.rb,
lib/crashdesk/context_base.rb,
lib/crashdesk/configuration.rb,
lib/crashdesk/report_manager.rb,
lib/crashdesk/reporters/test.rb,
lib/crashdesk/reporters/logger.rb,
lib/crashdesk/reporters/remote.rb,
lib/crashdesk/reporters/screen.rb,
lib/crashdesk/reporters/stderr.rb

Defined Under Namespace

Modules: Reporters Classes: Backtrace, Configuration, ContextBase, Crashlog, Environment, ReportManager

Constant Summary collapse

LOG_PREFIX =
"[Crashdesk] "
VERSION =
"0.2.5"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

The configuration object.

See Also:



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

def configuration
  @configuration ||= Configuration.new
end

Class Method Details

.configure(silent = false) {|configuration| ... } ⇒ Object

Call this method to modify defaults for Crashdesk.

Examples:

Crashdesk.configure do |config|
  config.api_key = 'someapikey'
end

Yields:



31
32
33
34
# File 'lib/crashdesk.rb', line 31

def configure(silent = false)
  yield(configuration) if block_given?
  configuration
end

.crashlog(exception, request, context, options = {}) ⇒ Object

Main method how to build crashlog from exception, context, and environment

See Also:

  • Craslog.initialize


48
49
50
# File 'lib/crashdesk.rb', line 48

def crashlog(exception, request, context, options = {})
  Crashlog.new(exception, request, context, options)
end

.log(message, severity = :info) ⇒ Object



42
43
44
# File 'lib/crashdesk.rb', line 42

def log(message, severity = :info)
  configuration.logger.send(severity, LOG_PREFIX + message) if configuration.logger
end