Sha256: d13f247a462b456461fda76e41ea26c3506c0358a4743ef78803ce296a4bb115
Contents?: true
Size: 794 Bytes
Versions: 9
Compression:
Stored size: 794 Bytes
Contents
module MotionPrime class Logger LOGGER_ERROR_LEVEL = 0 LOGGER_INFO_LEVEL = 1 LOGGER_DEBUG_LEVEL = 2 class_attribute :level def initialize @default_level = Config.logger.level.nil? ? :info : Config.logger.level end def error(*args) pp(*args) if LOGGER_ERROR_LEVEL <= current_level end def info(*args) pp(*args) if LOGGER_INFO_LEVEL <= current_level end def debug(*args) pp(*args) if LOGGER_DEBUG_LEVEL <= current_level end def current_level current_level = self.class.level || @default_level case current_level.to_s when 'error' LOGGER_ERROR_LEVEL when 'info' LOGGER_INFO_LEVEL when 'debug' LOGGER_DEBUG_LEVE else 2 end end end end
Version data entries
9 entries across 9 versions & 1 rubygems