lib/rails-cloud-tasks.rb in rails-cloud-tasks-0.0.1 vs lib/rails-cloud-tasks.rb in rails-cloud-tasks-0.0.2
- old
+ new
@@ -1,11 +1,15 @@
+require_relative './railtie'
+
require 'active_support'
require 'rails_cloud_tasks/rack/errors'
module RailsCloudTasks
extend ActiveSupport::Autoload
+ autoload :Scheduler
+ autoload :Credentials
autoload :Adapter
autoload :AppEngine
autoload :Configuration
autoload :Version
@@ -22,7 +26,17 @@
yield(config)
end
def self.config
@config ||= Configuration.new
+ end
+
+ def self.logger
+ return @logger if @logger
+
+ @logger ||= (Rails.logger || Logger.new($stdout)).tap do |logger|
+ logger.formatter = proc do |severity, datetime, _progname, msg|
+ "[#{datetime}] #{severity} [rails-cloud-tasks]: #{msg}\n"
+ end
+ end
end
end