I want to sprinkle my code (Ruby, not Rails) liberally with logging
calls so that when things go wrong I can see what happened.
is Ruby’s Logger class the best practice to use, or is there another
that’s cooler? For example it looks like Logger is not that flexible
about changing the format of log entries.
Is it better to define a global $Logger variable to hold the new
Logger object across classes and methods, or bettor to do a @l =
Logger.new(STDOUT) in each class’s initializer?
how do I minimize the overhead when logging is OFF?
is one of these idioms faster than the other:
@l.debug(“wow, what was that?”
@l.debug(“wow, what was that?” if debugging
@l.debug # no condition, just set @l.level = Logger::ERROR
Any other tips or pointers would be greatly appreciated!