Created
April 4, 2012 16:23
-
-
Save shime/2303494 to your computer and use it in GitHub Desktop.
[Airbrake] little hack to receive email on every occurrence of exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Airbrake.configure do |config| | |
config.api_key = '092f2e6780f7c9117353d28dbe8486a3' | |
config.development_environments = [] | |
end | |
module Airbrake | |
module Customization | |
def self.included(base) #:nodoc: | |
base.send(:alias_method_chain,:initialize,:customization) | |
end | |
def generate_hash | |
(0...50).map{ (('a'..'z').to_a + ('0'..'9').to_a).shuffle[rand(26)] }.join | |
end | |
def initialize_with_customization(args) | |
initialize_without_customization(args) | |
self.environment_name = "#{args[:environment_name]} - Custom Hash: #{generate_hash}" | |
end | |
end | |
end | |
Airbrake::Notice.send(:include,Airbrake::Customization) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment