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