Skip to content

Commit

Permalink
Add println and printf to LogTracer
Browse files Browse the repository at this point in the history
  • Loading branch information
64json committed Jan 24, 2019
1 parent 7e2cc20 commit cfa2878
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'org.algorithm_visualizer'
version = '2.1.0'
version = '2.2.0'
sourceCompatibility = 1.8

repositories {
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/algorithm_visualizer/LogTracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,17 @@ public LogTracer print(Object message) {
addTrace(key, "print", new Object[]{message});
return this;
}

public LogTracer println(Object message) {
addTrace(key, "println", new Object[]{message});
return this;
}

public LogTracer printf(String format, Object... args) {
Object[] traceArgs = new Object[args.length + 1];
traceArgs[0] = format;
System.arraycopy(args, 0, traceArgs, 1, args.length);
addTrace(key, "printf", traceArgs);
return this;
}
}

0 comments on commit cfa2878

Please sign in to comment.