mirror of
https://github.com/corda/corda.git
synced 2025-01-04 12:14:17 +00:00
Reduce agent output at startup to single line.
This commit is contained in:
parent
f5ed60caa6
commit
bf17169da7
@ -50,28 +50,30 @@ public final class Patcher implements ClassFileTransformer {
|
|||||||
* @param block the features to block
|
* @param block the features to block
|
||||||
*/
|
*/
|
||||||
public static void start(Instrumentation instr, Set<String> block, Properties props) throws IOException {
|
public static void start(Instrumentation instr, Set<String> block, Properties props) throws IOException {
|
||||||
System.out.println("Aegis4j patching starting");
|
System.out.print("Aegis4j patching starting...");
|
||||||
if (patcher != null) instr.removeTransformer(patcher);
|
if (patcher != null) instr.removeTransformer(patcher);
|
||||||
patcher = new Patcher(block, props);
|
patcher = new Patcher(block, props);
|
||||||
instr.addTransformer(patcher, true);
|
instr.addTransformer(patcher, true);
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
for (String className : patcher.modifications.keySet()) {
|
for (String className : patcher.modifications.keySet()) {
|
||||||
try {
|
try {
|
||||||
System.out.print("Aegis4j patching " + className + "...");
|
if (count > 0) System.out.print(", ");
|
||||||
|
System.out.print(className);
|
||||||
Class<?> clazz = Class.forName(className);
|
Class<?> clazz = Class.forName(className);
|
||||||
instr.retransformClasses(clazz);
|
instr.retransformClasses(clazz);
|
||||||
System.out.println();
|
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
System.out.println("not present.");
|
System.out.print("... not present");
|
||||||
} catch (NoClassDefFoundError e) {
|
} catch (NoClassDefFoundError e) {
|
||||||
System.out.println("not present.");
|
System.out.print("... not present");
|
||||||
} catch (UnmodifiableClassException e) {
|
} catch (UnmodifiableClassException e) {
|
||||||
throw new IOException("Problems transforming class", e);
|
throw new IOException("Problems transforming class", e);
|
||||||
}
|
}
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.setProperty("aegis4j.blocked.features", String.join(",", block));
|
System.setProperty("aegis4j.blocked.features", String.join(",", block));
|
||||||
System.out.println("Aegis4j patching finished");
|
System.out.println(" finished.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user