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
$log = Logger.new
so I can use $log anywhere in the code. Is it ellegant and “the Ruby
The other possibility I see is creating a class that stores the logger
instance into a @@class_variable (@@logger) and call class method
@@logger = Logger.new def self.debug(x) @@logger.debug(x) end ...
Which is a more ellegant way? is there other option?
Thanks for any advice I could receive from you.