From: Suraj Kurapati Date: 2008-06-23T08:29:59+09:00 Subject: Re: Is it ellegant to use a global variable to store a Logger object? 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. -- Posted via http://www.ruby-forum.com/.