Class: Demopass::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/demopass/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_level: nil) ⇒ Logger

Returns a new instance of Logger.



4
5
6
7
8
9
# File 'lib/demopass/logger.rb', line 4

def initialize(log_level: nil)
  log_level ||= env_log_level || rails_log_level || default_log_level
  return if log_level == :none

  @logger = ::Logger.new($stdout, level: log_level, progname: "Demopass")
end

Instance Method Details

#debug(message) ⇒ Object



11
12
13
# File 'lib/demopass/logger.rb', line 11

def debug(message)
  log(message, log_level: ::Logger::DEBUG)
end

#info(message) ⇒ Object



15
16
17
# File 'lib/demopass/logger.rb', line 15

def info(message)
  log(message, log_level: ::Logger::INFO)
end