El Lunes, 23 de Junio de 2008, Suraj Kurapati escribió: > Iñaki Baz Castillo wrote: > > $log = Logger.new > > $log.debug ... > > > > The other possibility I see is > > > > class MyLogger > > > > @@logger = Logger.new > > > > def self.debug(x) > > @@logger.debug(x) > > end > > end > > > > MyLogger.debug ... > > > > is there other option? > > You could add a debug() method to the Kernel module: > > module Kernel > @@logger = Logger.new > > def debug message > @@logger.debug message > end > end > > Then you could call it from anywhere in your code. Oh, interesting. Anyway let me a question: How ellegant is using Kernel module? 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? Thanks a lot. -- Iñaki Baz Castillo