ruby-changes:59132
From: Akira <ko1@a...>
Date: Mon, 9 Dec 2019 19:18:59 +0900 (JST)
Subject: [ruby-changes:59132] 6158e28f8d (master): [ruby/logger] Avoid creating [] and "" when logging an Exception that has no backtrace
https://git.ruby-lang.org/ruby.git/commit/?id=6158e28f8d From 6158e28f8d02026e21317d8a0c2cb2115b3a0660 Mon Sep 17 00:00:00 2001 From: Akira Matsuda <ronnie@d...> Date: Wed, 31 Jul 2019 14:38:38 +0900 Subject: [ruby/logger] Avoid creating [] and "" when logging an Exception that has no backtrace https://github.com/ruby/logger/commit/75fd308053 diff --git a/lib/logger/formatter.rb b/lib/logger/formatter.rb index 206c35d..852cffe 100644 --- a/lib/logger/formatter.rb +++ b/lib/logger/formatter.rb @@ -27,7 +27,7 @@ class Logger https://github.com/ruby/ruby/blob/trunk/lib/logger/formatter.rb#L27 when ::String msg when ::Exception - "#{ msg.message } (#{ msg.class })\n#{ (msg.backtrace || []).join("\n") }" + "#{ msg.message } (#{ msg.class })\n#{ msg.backtrace.join("\n") if msg.backtrace }" else msg.inspect end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/