[infinispan-commits] Infinispan SVN: r428 - trunk/bin.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Wed Jun 10 14:17:59 EDT 2009


Author: manik.surtani at jboss.com
Date: 2009-06-10 14:17:59 -0400 (Wed, 10 Jun 2009)
New Revision: 428

Added:
   trunk/bin/fixlogs.py
Log:


Added: trunk/bin/fixlogs.py
===================================================================
--- trunk/bin/fixlogs.py	                        (rev 0)
+++ trunk/bin/fixlogs.py	2009-06-10 18:17:59 UTC (rev 428)
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+
+import re
+import subprocess
+
+addresses = []
+
+def find(expr):
+  f = open("infinispan.log")
+  try:
+    for l in f:
+      if expr.match(l):
+        handle(l, expr)
+        break
+  finally:
+    f.close()
+
+def handle(l, expr):
+ # print l
+  m = expr.match(l)
+  members = m.group(1).strip()
+  for m in members.split(','):
+    addresses.append(m.strip())
+
+
+VIEW_TO_USE = '3'
+
+expr = re.compile('.*Received new cluster view.*\|%s. \[(.*)\].*' % VIEW_TO_USE)
+find(expr)
+#print 'Addresses = %s' % addresses
+i=1
+sed = "sed "
+for a in addresses:
+  sed += "-e 's/%s/%s/g' " % (a, "CACHE%s" % i)
+  i += 1
+
+sed += " infinispan.log > infinispan0.log"
+
+print """
+  
+  INFINISPAN Log file fixer.  Makes log files more readable by replacing ugly JGroups addresses to more friendly CACHE1, CACHE2, etc addresses.
+
+  Usage:
+
+    $ bin/fixlogs.py
+
+  TODO: be able to specify which view to selec as the correct one, and to specify input and output files.
+
+""" 
+
+print "TODO execute this sed script automatically!"
+
+print sed
+print "\n\n\n"
+
+#subprocess.call(sed)
+
+


Property changes on: trunk/bin/fixlogs.py
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the infinispan-commits mailing list