Sha256: 903813c66e97406742b40bf3de1c1fa639f8ff97f6730366002374888691e171

Contents?: true

Size: 341 Bytes

Versions: 11

Compression:

Stored size: 341 Bytes

Contents

require 'logger'

module UniqueJob
  module Logging
    def logger
      if File.basename($0) == 'rake'
        Logger.new(STDOUT, level: Logger::WARN)
      elsif defined?(Sidekiq)
        Sidekiq.logger
      elsif defined?(Rails)
        Rails.logger
      else
        Logger.new(STDOUT, level: Logger::WARN)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
unique_job-0.5.0 lib/unique_job/logging.rb
unique_job-0.4.4 lib/unique_job/logging.rb
unique_job-0.4.3 lib/unique_job/logging.rb
unique_job-0.4.2 lib/unique_job/logging.rb
unique_job-0.4.1 lib/unique_job/logging.rb
unique_job-0.4.0 lib/unique_job/logging.rb
unique_job-0.3.2.pre lib/unique_job/logging.rb
unique_job-0.3.1.pre lib/unique_job/logging.rb
unique_job-0.3.0.pre lib/unique_job/logging.rb
unique_job-0.2.1 lib/unique_job/logging.rb
unique_job-0.2.0 lib/unique_job/logging.rb