diff --git a/app/models/task.rb b/app/models/task.rb index dae66ea..3a28225 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -60,7 +60,7 @@ class Task < ActiveRecord::Base # FIXME # task.send(:send_notification, :created) rescue NotImplementedError => ex - RAILS_DEFAULT_LOGGER.info ex.to_s + Rails.logger.info ex.to_s end begin @@ -70,7 +70,7 @@ class Task < ActiveRecord::Base # TaskMailer.deliver_target_notification(task, target_msg) end rescue NotImplementedError => ex - RAILS_DEFAULT_LOGGER.info ex.to_s + Rails.logger.info ex.to_s end end end @@ -91,7 +91,7 @@ class Task < ActiveRecord::Base begin send_notification(:finished) rescue NotImplementedError => ex - RAILS_DEFAULT_LOGGER.info ex.to_s + Rails.logger.info ex.to_s end end after_finish @@ -119,7 +119,7 @@ class Task < ActiveRecord::Base begin send_notification(:cancelled) rescue NotImplementedError => ex - RAILS_DEFAULT_LOGGER.info ex.to_s + Rails.logger.info ex.to_s end end end @@ -225,7 +225,7 @@ class Task < ActiveRecord::Base # FIXME # self.send(:send_notification, :activated) rescue NotImplementedError => ex - RAILS_DEFAULT_LOGGER.info ex.to_s + Rails.logger.info ex.to_s end begin @@ -235,7 +235,7 @@ class Task < ActiveRecord::Base # TaskMailer.deliver_target_notification(self, target_msg) end rescue NotImplementedError => ex - RAILS_DEFAULT_LOGGER.info ex.to_s + Rails.logger.info ex.to_s end end diff --git a/lib/feed_handler.rb b/lib/feed_handler.rb index 32bb9db..9136c60 100644 --- a/lib/feed_handler.rb +++ b/lib/feed_handler.rb @@ -51,7 +51,7 @@ class FeedHandler end def process(container) - RAILS_DEFAULT_LOGGER.info("Processing %s with id = %d" % [container.class.name, container.id]) + Rails.logger.info("Processing %s with id = %d" % [container.class.name, container.id]) begin container.class.transaction do if container.update_errors > FeedHandler.max_errors && container.fetched_at < (Time.now - FeedHandler.disabled_period) @@ -65,8 +65,8 @@ class FeedHandler container.finish_fetch end rescue Exception => exception - RAILS_DEFAULT_LOGGER.warn("Unknown error from %s ID %d\n%s" % [container.class.name, container.id, exception.to_s]) - RAILS_DEFAULT_LOGGER.warn("Backtrace:\n%s" % exception.backtrace.join("\n")) + Rails.logger.warn("Unknown error from %s ID %d\n%s" % [container.class.name, container.id, exception.to_s]) + Rails.logger.warn("Backtrace:\n%s" % exception.backtrace.join("\n")) container.reload container.update_errors += 1 container.error_message = exception.to_s @@ -77,8 +77,8 @@ class FeedHandler begin container.finish_fetch rescue Exception => finish_fetch_exception - RAILS_DEFAULT_LOGGER.warn("Unable to finish fetch from %s ID %d\n%s" % [container.class.name, container.id, finish_fetch_exception.to_s]) - RAILS_DEFAULT_LOGGER.warn("Backtrace:\n%s" % finish_fetch_exception.backtrace.join("\n")) + Rails.logger.warn("Unable to finish fetch from %s ID %d\n%s" % [container.class.name, container.id, finish_fetch_exception.to_s]) + Rails.logger.warn("Backtrace:\n%s" % finish_fetch_exception.backtrace.join("\n")) end end end diff --git a/script/task-notifier b/script/task-notifier index d515be5..cecd970 100755 --- a/script/task-notifier +++ b/script/task-notifier @@ -8,5 +8,5 @@ ActionController::Base.init_gettext 'noosfero' Person.with_pending_tasks.each do |p| set_locale_all p.last_lang PendingTaskNotifier.deliver_notification(p) - RAILS_DEFAULT_LOGGER.info('deliver notification for ' + p.identifier) + Rails.logger.info('deliver notification for ' + p.identifier) end -- libgit2 0.21.2