lib/finitio/system.rb in finitio-0.7.0.pre.rc4 vs lib/finitio/system.rb in finitio-0.7.0
- old
+ new
@@ -95,19 +95,23 @@
def dup
System.new(@types.dup, @imports.dup)
end
- def check_and_warn(io = STDERR)
+ def check_and_warn(logger = nil)
+ logger ||= begin
+ require 'logger'
+ Logger.new(STDERR)
+ end
each_type do |t|
next unless t.named?
each_import do |i|
next unless found = i.get_type(t.name)
if found == t
- STDERR.puts "WARN: duplicate type def `#{t.name}`"
+ logger.info "Duplicate type def `#{t.name}`"
break
else
- STDERR.puts "NOTICE: Type erasure `#{t.name}`"
+ logger.warn "Type erasure `#{t.name}`"
break
end
end
end
self