Sha256: b6d93c0120249171f2cf7a036207375d6da54c543a1be2b74e03d551f834e5dc
Contents?: true
Size: 634 Bytes
Versions: 12
Compression:
Stored size: 634 Bytes
Contents
module Spacebunny # Log on multiple outputs at the same time # # Usage example: # # log_file = File.open("log/debug.log", "a") # Logger.new Spacebunny::Logger.new(STDOUT, log_file) class Logger def initialize(*args) @streams = [] args.each do |a| case a when String # This is a file path @streams << File.open(a, 'a+') else @streams << a end end end def write(*args) @streams.each do |lo| lo.write(*args) lo.flush end end def close @streams.each(&:close) end end end
Version data entries
12 entries across 12 versions & 1 rubygems