IƱaki Baz Castillo wrote:
> Imagine you are programming a framework
> that others can use in their programms. 
> Isn't dangerous to extend/modify
> Kernel module since it will be shared by *all* the code?

True.  In that case, I would put the debug() method or the LOG object in 
the top-level module of my library/framework:

# Using a debug() method
module FooBar
  module Logging
    @@logger = Logger.new

    def debug msg
      @@logger.debug msg
    end
  end

  class FooBar::Baz
    include Logging  # <== NOTE this!

    def oh_no
      debug "oh no!"
    end
  end
end

# Using a LOG object
module FooBar
  LOG = Logger.new

  class FooBar::Baz
    def oh_no
      LOG.debug "oh no!"
    end
  end
end
-- 
Posted via http://www.ruby-forum.com/.