I want a dual logger so I have sub-classed Logger with this :
class Logging < Logger
  def initialize(file, stdout=false)
    @log_file = Logger(file)
    @log_out = Logger(stdout) if stdout
  end
  #Override the logger's methods to write to both stdout and file if
needed
end

How would I implement a global logger for the module and the main. The
logger would be initiated within the main and I'd want to pass it to the
module with the same parameters, given a module like this :

module A
  def self.a
  end
 # Anywhere inside the module I want to be able to do logger.info(str)
and it will log to same logger as initialized in main.
  class c
    def ca
    end
  end
end

-- 
Posted via http://www.ruby-forum.com/.