aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Schweinsberg <[email protected]>2016-01-04 18:25:38 -0800
committerDavid Schweinsberg <[email protected]>2016-01-04 18:25:38 -0800
commit732313e8447c7d76986478d8fcd8ba716f8894c7 (patch)
treef7b3325563956526f84dc34d6ebf331376ef939c /src
parent49b6c2a3a3d852a31c8a09ae49e1ab953eec318b (diff)
Added SLF4J & Logback
Diffstat (limited to 'src')
-rw-r--r--src/net/java/dev/typecast/cff/T2Interpreter.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/net/java/dev/typecast/cff/T2Interpreter.java b/src/net/java/dev/typecast/cff/T2Interpreter.java
index baa4732..a8cb5a5 100644
--- a/src/net/java/dev/typecast/cff/T2Interpreter.java
+++ b/src/net/java/dev/typecast/cff/T2Interpreter.java
@@ -20,6 +20,8 @@ package net.java.dev.typecast.cff;
import java.util.ArrayList;
import net.java.dev.typecast.ot.Point;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Type 2 Charstring Interpreter. Operator descriptions are quoted from
@@ -41,6 +43,8 @@ public class T2Interpreter {
private static final int SUBR_STACK_LIMIT = 10;
private static final int TRANSIENT_ARRAY_ELEMENT_COUNT = 32;
+ static final Logger logger = LoggerFactory.getLogger(T2Interpreter.class);
+
private final Number[] _argStack = new Number[ARGUMENT_STACK_LIMIT];
private int _argStackIndex = 0;
private final SubrPair[] _subrStack = new SubrPair[SUBR_STACK_LIMIT];
@@ -1130,11 +1134,12 @@ public class T2Interpreter {
* Pop a value off the argument stack
*/
private Number popArg() {
-// System.out.print("popArg: " + _argStack[_argStackIndex - 1] + " (");
-// for (int i = 0; i < _argStackIndex - 1; ++i) {
-// System.out.print(" " + _argStack[i]);
-// }
-// System.out.println(")");
+ if (logger.isTraceEnabled()) {
+ logger.trace(
+ "popArg: {} {}",
+ _argStack[_argStackIndex - 1],
+ java.util.Arrays.copyOfRange(_argStack, 0, _argStackIndex - 1));
+ }
return _argStack[--_argStackIndex];
}
@@ -1143,11 +1148,12 @@ public class T2Interpreter {
*/
private void pushArg(Number n) {
_argStack[_argStackIndex++] = n;
-// System.out.print("pushArg: " + n + " (");
-// for (int i = 0; i < _argStackIndex - 1; ++i) {
-// System.out.print(" " + _argStack[i]);
-// }
-// System.out.println(")");
+ if (logger.isTraceEnabled()) {
+ logger.trace(
+ "pushArg: {} {}",
+ n,
+ java.util.Arrays.copyOfRange(_argStack, 0, _argStackIndex - 1));
+ }
}
/**