Sha256: fb1e204a28f2c62538c9337b3e6dc40fbb72d6df29bb2f9e782eae7536eff7ba
Contents?: true
Size: 671 Bytes
Versions: 40
Compression:
Stored size: 671 Bytes
Contents
class Miam::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, log_options = {}) message = "[#{level.to_s.upcase}] #{message}" unless level == :info message << ' (dry-run)' if @options[:dry_run] message = message.send(log_options[:color]) if log_options[:color] logger = @options[:logger] || Miam::Logger.instance logger.send(level, message) end end end
Version data entries
40 entries across 40 versions & 1 rubygems