[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84023] [Ruby trunk Feature#14141] Add a method to Exception for retrieving formatted exception for logging purpose (Exception#{formatted, display})
From:
her@...
Date:
2017-12-01 08:53:14 UTC
List:
ruby-core #84023
Issue #14141 has been updated by sorah (Sorah Fukumori).
> is slightly different than what the C code does, if the message spans multiple lines (then the (#{e.class}) is still on the first line).
meh, yes, I just gave up to write the exact Ruby code with the C-level behavior...
----------------------------------------
Feature #14141: Add a method to Exception for retrieving formatted exception for logging purpose (Exception#{formatted,display})
https://bugs.ruby-lang.org/issues/14141#change-68106
* Author: sorah (Sorah Fukumori)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version:
----------------------------------------
Most people want to log caught exceptions to stderr (or somewhere else) then continues their program as usual.
```
def the_program
# ...
raise "failure!"
# ...
rescue RuntimeError => e
$stderr.puts "#{e.message} (#{e.class})\n\t#{e.backtrace.join("\n\t")}"
retry
end
```
I'm very bored to write error logging many time...
I want to log errors in the default format of Ruby, just like the following:
```
rescue RuntimeError => e
e.display
# ...
```
From Ruby 2.5, we've started branching error formatting on TTY-ness of `$stderr`. It'd be bit more useful if we can log using the same format with the format which Ruby determines.
Ruby already has `Object#display`.
One consideration is to retrieve formatted String from Exception object, but the current error logging code (eval_error.c) depends on IO,
so I want to start from just having `Exception#display`. I think most use case is just to log errors into IO.
---Files--------------------------------
2.patch (8.74 KB)
0001-Add-Exception-formatted-to-get-a-formatted-string.patch (8.36 KB)
0002-Add-Exception-display-to-log-exception.patch (1.99 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>