Sha256: c8ccd0f95d5517075d2e78b1ce56695271c89512b6f144ce510a47657a1c30e0
Contents?: true
Size: 546 Bytes
Versions: 9
Compression:
Stored size: 546 Bytes
Contents
require "logger" require "fileutils" class Logger def self.log method, args, dry_run: false loggers = [::Logger.new(STDOUT)] if !dry_run FileUtils.mkdir_p("log") loggers << ::Logger.new("log/zonesync.log") end loggers.each do |logger| operation = case args when Array args.map { |h| h.values.join(" ") }.join(" -> ") when Hash args.values.join(" ") else raise args.inspect end logger.info "Zonesync: #{method.capitalize} #{operation}" end end end
Version data entries
9 entries across 9 versions & 1 rubygems