diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-08-10 10:58:22 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-08-10 10:58:22 -0300 |
| commit | 2acee8f9acf53fd8c1f97f8d40bf0bd6fd53148a (patch) | |
| tree | 8030a0d292218d1205b9f905945917641dc7eb73 /src/main/java/bjc/rgens/parser/RGrammarTest.java | |
| parent | 22ab7a4dd6e608b5ef4d30b1d2ba2816a382dd52 (diff) | |
Update logging
Logging now uses the RGrammarLogging system so as to allow for better
customizability of how the logging works
Diffstat (limited to 'src/main/java/bjc/rgens/parser/RGrammarTest.java')
| -rwxr-xr-x | src/main/java/bjc/rgens/parser/RGrammarTest.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/bjc/rgens/parser/RGrammarTest.java b/src/main/java/bjc/rgens/parser/RGrammarTest.java index 8193fa3..056ffd9 100755 --- a/src/main/java/bjc/rgens/parser/RGrammarTest.java +++ b/src/main/java/bjc/rgens/parser/RGrammarTest.java @@ -9,6 +9,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Random; +import static bjc.rgens.parser.RGrammarLogging.*; + /** * Test for new grammar syntax. * @@ -74,7 +76,7 @@ public class RGrammarTest { long suggDur = endSuggTime - startSuggTime; - System.err.printf("PERF: Generated rule suggestions for %s in %d ns (%f s)\n", gramName, suggDur, suggDur / 1000000000.0); + perf("Generated rule suggestions for %s in %d ns (%f s)", gramName, suggDur, suggDur / 1000000000.0); } System.err.printf("\n\n"); @@ -101,24 +103,20 @@ public class RGrammarTest { } } catch (GrammarException gex) { /* Print out errors with generation. */ - String fmt = "ERROR: Exported rule %s from %s failed (loaded from '%s')\n"; + String fmt = "Exported rule %s from %s failed (loaded from '%s')"; - System.out.printf(fmt, exportName, grammar.name, loadSrc); + System.out.printf("ERROR: " + fmt, exportName, grammar.name, loadSrc); System.out.println(); System.out.println(); - System.err.printf(fmt, exportName, grammar.name, loadSrc); - gex.printStackTrace(); - - System.err.println(); - System.err.println(); + error(gex, fmt, exportName, grammar.name, loadSrc); } } long endGenTime = System.nanoTime(); long genDur = endGenTime - startGenTime; - System.err.printf("PERF: Generated %s 100 times in %d ns (%f s)\n\n\n", exportName, genDur, genDur / 1000000000.0); + perf("Generated %s 100 times in %d ns (%f s)", exportName, genDur, genDur / 1000000000.0); } } } |
