Sha256: 11bb1e0ca7b2d8ea74845ee8723964074b4181791d05b9b6842c686623ccd82c
Contents?: true
Size: 725 Bytes
Versions: 8
Compression:
Stored size: 725 Bytes
Contents
class Radiosonde::Logger < ::Logger include Singleton def initialize super($stdout) self.formatter = proc do |severity, datetime, progname, msg| "#{msg}\n" end self.level = Logger::INFO end def set_debug(value) self.level = value ? Logger::DEBUG : Logger::INFO end module Helper def log(level, message, color, log_id = nil) message = "[#{level.to_s.upcase}] #{message}" unless level == :info message << ": #{log_id}" if log_id message << ' (dry-run)' if @options && @options[:dry_run] logger = (@options && @options[:logger]) || Radiosonde::Logger.instance message = message.send(color) if color logger.send(level, message) end end end
Version data entries
8 entries across 8 versions & 1 rubygems