Support new style diagnostic reports
This commit is contained in:
parent
4378de02f9
commit
3cbe37bd35
@ -297,16 +297,24 @@ module EnvUtil
|
|||||||
cmd = @ruby_install_name if "ruby-runner#{RbConfig::CONFIG["EXEEXT"]}" == cmd
|
cmd = @ruby_install_name if "ruby-runner#{RbConfig::CONFIG["EXEEXT"]}" == cmd
|
||||||
path = DIAGNOSTIC_REPORTS_PATH
|
path = DIAGNOSTIC_REPORTS_PATH
|
||||||
timeformat = DIAGNOSTIC_REPORTS_TIMEFORMAT
|
timeformat = DIAGNOSTIC_REPORTS_TIMEFORMAT
|
||||||
pat = "#{path}/#{cmd}_#{now.strftime(timeformat)}[-_]*.crash"
|
pat = "#{path}/#{cmd}_#{now.strftime(timeformat)}[-_]*.{crash,ips}"
|
||||||
first = true
|
first = true
|
||||||
30.times do
|
30.times do
|
||||||
first ? (first = false) : sleep(0.1)
|
first ? (first = false) : sleep(0.1)
|
||||||
Dir.glob(pat) do |name|
|
Dir.glob(pat) do |name|
|
||||||
log = File.read(name) rescue next
|
log = File.read(name) rescue next
|
||||||
if /\AProcess:\s+#{cmd} \[#{pid}\]$/ =~ log
|
case name
|
||||||
File.unlink(name)
|
when /\.crash\z/
|
||||||
File.unlink("#{path}/.#{File.basename(name)}.plist") rescue nil
|
if /\AProcess:\s+#{cmd} \[#{pid}\]$/ =~ log
|
||||||
return log
|
File.unlink(name)
|
||||||
|
File.unlink("#{path}/.#{File.basename(name)}.plist") rescue nil
|
||||||
|
return log
|
||||||
|
end
|
||||||
|
when /\.ips\z/
|
||||||
|
if /^ *"pid" *: *#{pid},/ =~ log
|
||||||
|
File.unlink(name)
|
||||||
|
return log
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user