Module: Loggable::ClassMethods
Constant Summary collapse
- @@logger =
nil
Instance Method Summary collapse
- #logger ⇒ Object
-
#logger=(logger) ⇒ Object
Use this method on any of your classes to trigger the logging facility:.
Instance Method Details
#logger ⇒ Object
18 19 20 |
# File 'lib/loggable/log_methods.rb', line 18 def logger @@logger || LoggerStub.new end |
#logger=(logger) ⇒ Object
Use this method on any of your classes to trigger the logging facility:
MyClass.logger = Logger.new('/path/to/logfile')
Now you can call the ‘logger’ method inside a class or instance method to log at the specified level. See the README for details.
14 15 16 |
# File 'lib/loggable/log_methods.rb', line 14 def logger=(logger) @@logger = logger end |