Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breadcrumbs support #113

Merged
merged 24 commits into from
Apr 27, 2017
Merged

Breadcrumbs support #113

merged 24 commits into from
Apr 27, 2017

Conversation

UberMouse
Copy link
Contributor

@UberMouse UberMouse commented Mar 24, 2017

Support for Rayguns new breadcrumbs feature. Breadcrumbs let you provide logging points in your code that will be collected and sent along with any exception sent to Raygun. This lets you have a better understanding of the events that happened in the system that lead up to the exception.

There are two ways of recording a breadcrumb

  1. Include it as a module in your class
class SomeClass
  include Raygun::Breadcrumbs
  
  def some_method
    record_breadcrumb(
      message: "<log message goes here>",
      category: "some category to group them by, maybe authentication or external-apis for example",
      level: :info, # or debug or warning etc, you can configure what level will get sent
      metadata: {custom_data: 'can go here'},
    )
  end
end

This has the added benefit of recording the class the breadcrumb was recorded from automatically

  1. Call the record_breadcrumb method manually
def some_method
  Raygun.record_breadcrumb(
    message: "<log message goes here>",
    category: "some category to group them by, maybe authentication or external-apis for example",
    level: :info, # or debug or warning etc, you can configure what level will get sent
    metadata: {custom_data: 'can go here'},
    
    # You can also set the class the breadcrumb was logged from 
    # It will only be set automatically using the included module approach
    # Method and line number will get added automatically
    class_name: self.class.name
  )
end

This change is Reviewable

@UberMouse UberMouse force-pushed the breadcrumbs-support branch from 69a6be9 to 0780f4a Compare March 28, 2017 20:30
@UberMouse UberMouse force-pushed the breadcrumbs-support branch from c04ba06 to 50c19fe Compare April 19, 2017 21:30
@UberMouse UberMouse changed the title WIP: Breadcrumbs support Breadcrumbs support Apr 27, 2017
@UberMouse UberMouse merged commit 797ef7e into master Apr 27, 2017
@UberMouse UberMouse deleted the breadcrumbs-support branch April 27, 2017 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant