mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- use Enumerable#detect instead of Enumerable.select{}[0]
- don't use self.send
This commit is contained in:
parent
e5b829fe05
commit
8bc2a55a27
1 changed files with 3 additions and 2 deletions
|
@ -27,7 +27,7 @@ class LogStash::Logger < Logger
|
|||
@@notify_awesome_print_load_failed = nil
|
||||
end
|
||||
|
||||
@formatter.progname = self.send(:progname=, File.basename($0))
|
||||
@formatter.progname = self.progname = File.basename($0)
|
||||
info("Using formatter: #{@formatter}")
|
||||
end # def initialize
|
||||
|
||||
|
@ -56,7 +56,8 @@ class LogStash::Logger::Formatter < Logger::Formatter
|
|||
# This only works if you use the severity methods
|
||||
path, line, method = caller[3].split(/(?::in `|:|')/)
|
||||
# Trim RUBYLIB path from 'file' if we can
|
||||
whence = $:.select { |p| path.start_with?(p) }[0]
|
||||
#whence = $:.select { |p| path.start_with?(p) }[0]
|
||||
whence = $:.detect { |p| path.start_with?(p) }
|
||||
if !whence
|
||||
# We get here if the path is not in $:
|
||||
file = path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue