view scripts/log.rb @ 81:02dfb6c72632 working

This is movement test
author sugi
date Thu, 24 May 2012 00:20:16 +0900
parents 92aeb6e34683
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 "}"