class SecureNative::Log

Public Class Methods

debug(msg) click to toggle source
# File lib/securenative/utils/log.rb, line 34
def self.debug(msg)
  @logger.debug(msg)
end
error(msg) click to toggle source
# File lib/securenative/utils/log.rb, line 42
def self.error(msg)
  @logger.error(msg)
end
info(msg) click to toggle source
# File lib/securenative/utils/log.rb, line 30
def self.info(msg)
  @logger.info(msg)
end
init_logger(level = 'DEBUG') click to toggle source
# File lib/securenative/utils/log.rb, line 9
def self.init_logger(level = 'DEBUG')
  @logger.level = case level
                  when 'WARN'
                    Logger::WARN
                  when 'DEBUG'
                    Logger::DEBUG
                  when 'ERROR'
                    Logger::ERROR
                  when 'FATAL'
                    Logger::FATAL
                  when 'INFO'
                    Logger::INFO
                  else
                    Logger::FATAL
                  end

  @logger.formatter = proc do |severity, datetime, progname, msg|
    "[#{datetime}] #{severity}  (#{progname}): #{msg}\n"
  end
end
warning(msg) click to toggle source
# File lib/securenative/utils/log.rb, line 38
def self.warning(msg)
  @logger.warning(msg)
end