Sha256: a7afae31ce137fe1140511f258d1e037c283cfa44118fce9e5a404f4b930ede1

Contents?: true

Size: 481 Bytes

Versions: 26

Compression:

Stored size: 481 Bytes

Contents

module QdLogger
  attr_accessor :logger

  def initialize_logger(logger = nil)
    @logger = logger || Logger.new("#{File.expand_path(Rails.root)}/log/queue_dispatcher.log")
  end

  # Write a standart log message
  def log(args = {})
    sev = args[:sev] || :info
    msg = Time.now.to_s + " #{sev.to_s.upcase} #{$$} (#{self.class.name}): " + args[:msg]
    logger.send(sev, msg) if logger
    puts "#{sev.to_s.upcase}: #{args[:msg]}" if logger.nil? || args[:print_log]
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
queue_dispatcher-2.5.3 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-2.3.0 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-2.1.0 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.5.1 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.3.1 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.3.0 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.2.0 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.19 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.18 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.17 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.16 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.15 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.14 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.12 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.11 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.10 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.9 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.8 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.7 lib/queue_dispatcher/qd_logger.rb
queue_dispatcher-1.1.6 lib/queue_dispatcher/qd_logger.rb