Project

General

Profile

Actions

Feature #17143

open

Improve support for warning categories

Added by jeremyevans0 (Jeremy Evans) 11 months ago. Updated 8 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:99856]

Description

Support was recently added for Warning.warn to accept a category keyword. However, the initial implementation was limited to having rb_warn_deprecated and rb_warn_deprecated_to_remove use the :deprecated value for the category keyword.

It doesn't make sense to me to have a category keyword if it is only used for deprecation, so I propose we extend the support so that Kernel#warn accepts a category keyword (for Ruby-level warnings) and rb_category_warn and rb_category_warning functions be added to the C-API (for C-level warnings). I also propose that we change existing rb_warn and rb_warning calls to rb_category_warn and rb_category_warning, so that all warnings issued by core Ruby are issued with an appropriate category.

I have implemented support for this in a pull request: https://github.com/ruby/ruby/pull/3508


Related issues

Related to Ruby master - Feature #17055: Allow suppressing uninitialized instance variable and method redefined verbose mode warningsClosedActions
Actions

Also available in: Atom PDF