Sha256: 88c2743c69c2693d1487d00d28ea73294de87f02b7af7c80c81c14a9e7ab90d5

Contents?: true

Size: 411 Bytes

Versions: 1

Compression:

Stored size: 411 Bytes

Contents

module ActiveJob
  module Cron
    module Loggable
      %w(fatal error warn info debug).each do |level|
        level = level.to_sym

        define_method(level) do |msg|
          if logger = ActiveJob::Cron.config.logger
            logger.__send__(level, "[ActiveJob::Cron] #{msg}")
          else
            puts "[ActiveJob::Cron] #{level}: #{msg}"
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_job-cron-0.1.0 lib/active_job/cron/loggable.rb