Sha256: be6fe300708bd684d20e2e32bbc88b0975ab940f1f78ed4ee616ed15665e6766
Contents?: true
Size: 599 Bytes
Versions: 12
Compression:
Stored size: 599 Bytes
Contents
require "logger" class ZabbixRubyClient module Logger extend self def get_logger(dir, level) logger = ::Logger.new(File.join(dir,"zrc.log")) logger.level = get_level_constant(level) logger.formatter = proc do |severity, datetime, progname, msg| "[#{datetime.utc}] #{severity}: #{msg}\n" end logger end def get_level_constant(level) if level begin ::Logger.const_get(level.to_s.upcase) rescue NameError return ::Logger::INFO end else ::Logger::INFO end end end end
Version data entries
12 entries across 12 versions & 1 rubygems