class SimpleLogger
Constants
- LOG_LEVELS
Attributes
level[W]
Public Class Methods
new(default_level: :debug)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 6 def initialize(default_level: :debug) @level = LOG_LEVELS.index(default_level) end
Public Instance Methods
debug(*)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 10 def debug(*) log_if_level_valid(:debug) end
error(*)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 22 def error(*) log_level_if_valid(:error) end
fatal(*)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 26 def fatal(*) log_level_if_valid(:fatal) end
info(*)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 14 def info(*) log_if_level_valid(:info) end
unknown(*)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 30 def unknown(*) log_level_if_valid(:unknown) end
warn(*)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 18 def warn(*) log_if_level_valid(:warn) end
Private Instance Methods
log(*)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 41 def log(*) print '.' end
log_if_level_valid(level_sym)
click to toggle source
# File lib/gem_checks/simple_logger.rb, line 36 def log_if_level_valid(level_sym) return unless @level <= LOG_LEVELS.index(level_sym) log end