module SmartWatch::Logger
Public Class Methods
configure_logger_for(classname)
click to toggle source
# File lib/smart_watch/logger.rb, line 27 def configure_logger_for(classname) logger = ::Logger.new($stdout) logger.level = ::Logger.const_get("#{SmartWatch.config.logger_level}".upcase) logger.progname = classname logger end
included(base)
click to toggle source
# File lib/smart_watch/logger.rb, line 14 def self.included(base) class << base def logger @logger ||= SmartWatch::Logger.logger_for(self.name) end end end
logger_for(classname)
click to toggle source
# File lib/smart_watch/logger.rb, line 23 def logger_for(classname) @loggers[classname] ||= configure_logger_for(classname) end
Public Instance Methods
logger()
click to toggle source
# File lib/smart_watch/logger.rb, line 7 def logger @logger ||= SmartWatch::Logger.logger_for(self.class.name) end