1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
From: Guilherme Puida Moreira <puida@debian.org>
Date: Fri, 6 Mar 2026 15:38:58 -0300
Subject: Fix kernel backtrace regex
Ruby 3.4 changed the formatting of backtraces, which are here parsed to extract
the method name.
Forwarded: no
---
lib/logging/log_event.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/logging/log_event.rb b/lib/logging/log_event.rb
index 35ce66f..94266f1 100644
--- a/lib/logging/log_event.rb
+++ b/lib/logging/log_event.rb
@@ -10,7 +10,7 @@ module Logging
# * $1 == filename
# * $2 == line number
# * $3 == method name (might be nil)
- CALLER_RGXP = %r/([-\.\/\(\)\w]+):(\d+)(?::in `([^']+)')?/o
+ CALLER_RGXP = %r/([-\.\/\(\)\w]+):(\d+)(?::in [`']([^']+)')?/o
#CALLER_INDEX = 2
CALLER_INDEX = ((defined?(JRUBY_VERSION) && JRUBY_VERSION > '1.6' && JRUBY_VERSION < '9.0') ||
(defined?(RUBY_ENGINE) && RUBY_ENGINE[%r/^rbx/i])) ? 1 : 2
@@ -39,7 +39,7 @@ module Logging
match = CALLER_RGXP.match(stack)
self.file = match[1]
self.line = Integer(match[2])
- self.method_name = match[3] unless match[3].nil?
+ self.method_name = match[3].split('#').last unless match[3].nil?
if (bp = ::Logging.basepath) && !bp.empty? && file.index(bp) == 0
self.file = file.slice(bp.length + 1, file.length - bp.length)
|