Sha256: 7fb7b88dfd81b23af0949341263c4b351d9b3044ad2d481d57d1c658b45db1cc
Contents?: true
Size: 771 Bytes
Versions: 15
Compression:
Stored size: 771 Bytes
Contents
module Dyna class 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 ClientHelper 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) || Dyna::Logger.instance message = message.send(color) if color logger.send(level, message) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems