1 18 19 package org.objectweb.jac.util; 20 21 import java.io.FilenameFilter ; 22 import java.io.IOException ; 23 import java.util.Iterator ; 24 import java.util.List ; 25 import net.sf.just4log.JustLog; 26 import org.apache.log4j.BasicConfigurator; 27 import org.apache.log4j.Level; 28 import org.apache.log4j.Logger; 29 import org.objectweb.jac.util.File; 30 import org.objectweb.jac.util.Files; 31 32 35 public class SpeedLog { 36 41 public static void main(String [] args) throws IOException { 42 BasicConfigurator.configure(); 43 Logger.getRootLogger().setLevel(Level.WARN); 44 45 for (int i=0; i<args.length; i++) 46 { 47 File file = new File(args[i]); 48 if (file.isDirectory()) { 49 List classes = 50 file.listFilesRecursively( 51 Files.extensionFilenamFilter(".class")); 52 Iterator it = classes.iterator(); 53 while(it.hasNext()) { 54 File classFile = (File)it.next(); 55 try { 56 JustLog.speedup(classFile,classFile); 57 } catch(Exception e) { 58 System.out.println("Failed to speed "+classFile); 59 } 60 } 61 } else { 62 try { 63 JustLog.speedup(file,file); 64 } catch(Exception e) { 65 System.out.println("Failed to speed "+file); 66 } 67 } 68 } 69 } 70 } 71 | Popular Tags |