[slf4j-dev] svn commit: r1222 - in slf4j/trunk/slf4j-ext/src/main/java/org/slf4j: agent instrumentation
ravn at slf4j.org
ravn at slf4j.org
Mon Nov 10 00:14:19 CET 2008
Author: ravn
Date: Mon Nov 10 00:14:19 2008
New Revision: 1222
Modified:
slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/agent/AgentPremain.java
slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java
slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java
Log:
cleaned source and javadoc preparing for 1.5.6 release
Modified: slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/agent/AgentPremain.java
==============================================================================
--- slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/agent/AgentPremain.java (original)
+++ slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/agent/AgentPremain.java Mon Nov 10 00:14:19 2008
@@ -12,7 +12,7 @@
/**
* Entry point for slf4j-ext when used as a Java agent.
- *
+ *
*/
public class AgentPremain {
@@ -21,9 +21,8 @@
/**
* JavaAgent premain entry point as specified in the MANIFEST.MF file. See
- * {@link http
- * ://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary
- * .html} for details.
+ * {@link http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary.html}
+ * for details.
*
* @param agentArgument
* string provided after "=" up to first space
@@ -48,7 +47,8 @@
}
if (args.containsKey(AgentOptions.IGNORE)) {
- builder = builder.ignore(args.getProperty(AgentOptions.IGNORE).split(","));
+ String ignore = args.getProperty(AgentOptions.IGNORE);
+ builder = builder.ignore(ignore.split(","));
}
if (args.containsKey(AgentOptions.LEVEL)) {
Modified: slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java
==============================================================================
--- slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java (original)
+++ slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java Mon Nov 10 00:14:19 2008
@@ -74,7 +74,6 @@
CodeAttribute codeAttribute = method.getMethodInfo().getCodeAttribute();
LocalVariableAttribute locals = null;
-
if (codeAttribute != null) {
AttributeInfo attribute;
@@ -151,7 +150,8 @@
String variableName = locals.variableName(j);
if (variableName.equals("this")) {
System.err.println("'this' returned as a parameter name for "
- + method.getName() + " index " + j + ", names are probably shifted.");
+ + method.getName() + " index " + j
+ + ", names are probably shifted. Please submit source for class in slf4j bugreport");
}
return variableName;
}
Modified: slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java
==============================================================================
--- slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java (original)
+++ slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java Mon Nov 10 00:14:19 2008
@@ -70,11 +70,11 @@
boolean addVariableAssignment;
- private Builder addVariableAssignment(boolean b) {
- System.err.println("cannot currently log variable assignments.");
- addVariableAssignment = b;
- return this;
- }
+// private Builder addVariableAssignment(boolean b) {
+// System.err.println("cannot currently log variable assignments.");
+// addVariableAssignment = b;
+// return this;
+// }
boolean verbose;
@@ -119,7 +119,7 @@
private LogTransformer(Builder builder) {
this.addEntryExit = builder.addEntryExit;
- this.addVariableAssignment = builder.addVariableAssignment;
+// this.addVariableAssignment = builder.addVariableAssignment;
this.verbose = builder.verbose;
this.ignore = builder.ignore;
this.level = builder.level;
@@ -130,7 +130,7 @@
private static final String _LOG = "_log";
private boolean addEntryExit;
- private boolean addVariableAssignment;
+// private boolean addVariableAssignment;
private boolean verbose;
private String[] ignore;
@@ -140,7 +140,7 @@
try {
return transform0(className, clazz, bytes);
} catch (Exception e) {
- // TODO Auto-generated catch block
+ System.err.println("Could not instrument " + className);
e.printStackTrace();
return bytes;
}
@@ -163,7 +163,7 @@
}
}
if (verbose) {
- System.err.println("Loggifying " + className);
+ System.err.println("Processing " + className);
}
return doClass(className, clazz, bytes);
}
More information about the slf4j-dev
mailing list