From: "Iñaki Baz Castillo" Date: 2008-06-23T06:53:28+09:00 Subject: Is it ellegant to use a global variable to store a Logger object? Hi, I use Logger class in a programm and since I need to log in lot of different places (into classes, into methods...) I use a global variable in this way: $log = Logger.new $log.debug ... so I can use $log anywhere in the code. Is it ellegant and "the Ruby way"? The other possibility I see is creating a class that stores the logger instance into a @@class_variable (@@logger) and call class method anywhere in the code: class MyLogger @@logger = Logger.new def self.debug(x) @@logger.debug(x) end ... end MyLogger.debug ... Which is a more ellegant way? is there other option? Thanks for any advice I could receive from you. -- Iñaki Baz Castillo