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