Sha256: 4cc446db675c084587b3bcc4213cd414a0054bc2e7d87e95305a4c825154279d
Contents?: true
Size: 692 Bytes
Versions: 7
Compression:
Stored size: 692 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 logger.send(level, message.send(color)) end end end
Version data entries
7 entries across 7 versions & 1 rubygems