1 46 package groovy.util; 47 48 import groovy.lang.GroovyObjectSupport; 49 50 51 52 60 public class GroovyLog extends GroovyObjectSupport { 61 62 String prefix; 63 64 67 public static GroovyLog newInstance(Class aClass) { 68 return new GroovyLog(aClass); 69 } 70 71 public GroovyLog() { 72 this(""); 73 } 74 75 public GroovyLog(Class owner) { 76 this(owner.getName()); 77 } 78 79 public GroovyLog(String prefix) { 80 this.prefix = (prefix != null && prefix.length() > 0) ? "[" + prefix + ":" : "["; 81 } 82 83 public Object invokeMethod(String name, Object args) { 84 System.out.println(prefix + name + "] " + args); 85 return null; 86 } 87 } 88 | Popular Tags |