Project

General

Profile

Actions

Feature #5029

closed

accept multiple args in Kernel#warn(), like puts()

Added by sunaku (Suraj Kurapati) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:38070]

Description

Hello,

Please make Kernel#warn() like Kernel#puts():

  • Accept multiple arguments.
  • Print them separated by newline.

This will allow me to warn exceptions easily:

begin
...
rescue => error
warn error.inspect, error.backtrace
end

Instead of the current way, of having to write:

begin
...
rescue => error
warn error.inspect
warn error.backtrace.join("\n")
end

Thanks for your consideration.


Files

0001-Changed-rb_warn_m-to-accept-variable-arguments.patch (1.58 KB) 0001-Changed-rb_warn_m-to-accept-variable-arguments.patch Changed rb_warn_m to accept variable arguments boredomist (Erik Price), 07/17/2011 11:06 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0