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

Move log methods to public section #498

Merged
merged 2 commits into from
Jul 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion gemfiles/rails42.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ gem "rails", "4.2.3"
gem 'rspec-rails', '~> 3.4'
gem 'rake'

gem 'oj', '~> 2.12.14' unless is_jruby
gem 'sidekiq', '>= 2.13.0' if RUBY_VERSION != '1.8.7'

if RUBY_VERSION.start_with?('1.9')
Expand All @@ -25,6 +24,12 @@ elsif RUBY_VERSION.start_with?('2')
gem 'sucker_punch', '~> 2.0'
end

if RUBY_VERSION.start_with?('2.4')
gem 'oj', '~> 2.16.0' unless is_jruby
else
gem 'oj', '~> 2.12.14' unless is_jruby
end

gem 'sinatra'
gem 'resque'
gem 'delayed_job', :require => false
Expand Down
14 changes: 7 additions & 7 deletions lib/rollbar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ def send_failsafe(message, exception)
failsafe_payload
end

## Logging
%w(debug info warn error).each do |level|
define_method(:"log_#{level}") do |message|
logger.send(level, message)
end
end

private

def call_before_process(options)
Expand Down Expand Up @@ -619,13 +626,6 @@ def async_failover(item)
end
end

## Logging
%w(debug info warn error).each do |level|
define_method(:"log_#{level}") do |message|
logger.send(level, message)
end
end

alias_method :log_warning, :log_warn

def log_instance_link(data)
Expand Down