view scripts/log.rb @ 42:92aeb6e34683

implements close exception
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Fri, 03 Feb 2012 14:59:05 +0900
parents 20616fe4d28a
children
line wrap: on
line source

log_file = ARGV[0]
puts "digraph test {"
open(log_file) { |io|
  while line = io.gets
    data = line.split("\t")
    header = data[0].split(" ")
    if header[2] != "DEBUG" then
      next
    end
    if header[3] == "alice.codesegment.CodeSegmentManager" then
      next
    end
    if header[5] == "TAKE" || header[5] == "PEEK" then
      puts '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"' + ' [shape="box", fontname="Ricty"]'
      print '"' + header[3] + "." + data[1] + '"' + ' [fontname="Ricty"]'
      print '"' + header[3] + "." + data[1] + '"'
      print " -> "
      print '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"'

      puts ' [label="' + header[5] + '", fontname="Ricty"]'
    end
    if header[5] == "PUT" || header[5] == "UPDATE" then
      puts '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"' + ' [shape="box", fontname="Ricty"]'
      puts '"' + header[3] + "." + data[1] + '"' + ' [fontname="Ricty"]'
      print '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"'
      print " -> "
      print '"' + header[3] + "." + data[1] + '"'
      puts ' [label="' + header[5] + '", fontname="Ricty"]'
    end
  end
}
puts "}"