ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:119726] [Ruby master Feature#20864] Support `error:` keyword to `Kernel#warn`
@ 2024-11-05 11:21 ioquatix (Samuel Williams) via ruby-core
  2024-11-05 12:26 ` [ruby-core:119727] " zverok (Victor Shepelev) via ruby-core
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: ioquatix (Samuel Williams) via ruby-core @ 2024-11-05 11:21 UTC (permalink / raw)
  To: ruby-core; +Cc: ioquatix (Samuel Williams)

Issue #20864 has been reported by ioquatix (Samuel Williams).

----------------------------------------
Feature #20864: Support `error:` keyword to `Kernel#warn`
https://bugs.ruby-lang.org/issues/20864

* Author: ioquatix (Samuel Williams)
* Status: Open
----------------------------------------
`Kernel#warn` is extremely useful.

It is possible to include some details about the current caller using `uplevel` for the current call stack. But it is not possible to include details about errors.

I'd like to propose another extension to log errors.

```ruby
begin
  # some work
rescue => error
  warn "An error occurred!", error: error
end
```

Such a feature would allow us to log errors using a standard interface.

I don't have an opinion about the implementation, but I wanted to get feedback on the interface.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-11-08 12:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-05 11:21 [ruby-core:119726] [Ruby master Feature#20864] Support `error:` keyword to `Kernel#warn` ioquatix (Samuel Williams) via ruby-core
2024-11-05 12:26 ` [ruby-core:119727] " zverok (Victor Shepelev) via ruby-core
2024-11-05 13:47 ` [ruby-core:119729] " Eregon (Benoit Daloze) via ruby-core
2024-11-05 15:04 ` [ruby-core:119734] " ioquatix (Samuel Williams) via ruby-core
2024-11-05 16:14 ` [ruby-core:119742] " Dan0042 (Daniel DeLorme) via ruby-core
2024-11-05 22:05 ` [ruby-core:119754] " ioquatix (Samuel Williams) via ruby-core
2024-11-06 22:26 ` [ruby-core:119785] [Ruby master Feature#20864] Allow `Kernel#warn` to accept `**options` and pass these to `Warning.warn` ioquatix (Samuel Williams) via ruby-core
2024-11-06 23:38 ` [ruby-core:119786] " jeremyevans0 (Jeremy Evans) via ruby-core
2024-11-06 23:53 ` [ruby-core:119787] " ioquatix (Samuel Williams) via ruby-core
2024-11-07  1:26 ` [ruby-core:119788] " ioquatix (Samuel Williams) via ruby-core
2024-11-07  5:56 ` [ruby-core:119790] " ko1 (Koichi Sasada) via ruby-core
2024-11-07  6:09 ` [ruby-core:119791] " ioquatix (Samuel Williams) via ruby-core
2024-11-08  9:00 ` [ruby-core:119837] " shyouhei (Shyouhei Urabe) via ruby-core
2024-11-08 12:26 ` [ruby-core:119841] " Eregon (Benoit Daloze) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).