Improve warning semantics
Two suggestions for future version of Ruby that wold make warning levels more intuitive easier to work with.
First, rename $VERBOSE to $WARN for these reasons:
rubyflags that set $VERBOSE are
- $VERBOSE controls output produced by
- $VERBOSE and FileUtils:Verbose are unrelated.
- $WARN is shorter ;-)
Second, it is confusing that
false mean different levels. Instead of the current
nil as level 0,
false as level 1, and
true as level 2, it would be nice if
false both mean "off", and then go from 0 on up to mean "on" of increasing degree. Just to clarify my meaning (not a use case example):
# nil, false mean no warning if $WARN case $WARN when 0 # lesser level of warning when 1 # greater level of warning when 2 # can go higher if needed for rare use case end end
These are incompatible changes, but can be phased-in with support both $WARN and $VERBOSE for intermediate period.