Module: Apiway::LoggerBase

Defined in:
lib/apiway/logger.rb

Class Method Summary collapse

Class Method Details

.activerecord_log_level(level) ⇒ Object



12
13
14
# File 'lib/apiway/logger.rb', line 12

def activerecord_log_level( level )
  ActiveRecord::Base.logger = level ? set_log_level( new_logger, level ) : false
end

.apiway_log_level(level) ⇒ Object



8
9
10
# File 'lib/apiway/logger.rb', line 8

def apiway_log_level( level )
  set_log_level( Log, level || :unknown )
end

.new_loggerObject



16
17
18
19
20
21
22
# File 'lib/apiway/logger.rb', line 16

def new_logger
  logger           = Logger.new STDOUT
  logger.formatter = proc do |severity, datetime, progname, msg|
    "#{ datetime.strftime( "%H:%M:%S" ) } - #{ severity }>  #{ msg }\n"
  end
  logger
end