Mercurial > hg > graal-compiler
changeset 14092:13072c084e6f
TruffleCompiler: avoid interleaved output with application and compiler
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Thu, 06 Mar 2014 23:17:10 +0100 |
parents | ed92bc6900d5 |
children | dd783f0ecf17 34efe38ee8d8 |
files | graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java |
diffstat | 1 files changed, 8 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Thu Mar 06 17:46:11 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Thu Mar 06 23:17:10 2014 +0100 @@ -467,20 +467,18 @@ properties.put("ASTSize", value); } - static synchronized void log(int indent, String msg, String details, Map<String, Object> properties) { - OUT.printf("[truffle] %-16s ", msg); - for (int i = 0; i < indent; i++) { - OUT.print(" "); - } - OUT.printf("%-" + (60 - indent) + "s", details); + static void log(int indent, String msg, String details, Map<String, Object> properties) { + StringBuilder sb = new StringBuilder(); + sb.append(String.format("[truffle] %-16s ", msg)); + sb.append(String.format("%" + indent + "s" + "%-" + (60 - indent) + "s", "", details)); if (properties != null) { for (String property : properties.keySet()) { Object value = properties.get(property); if (value == null) { continue; } - OUT.print("|"); - OUT.print(property); + sb.append('|'); + sb.append(property); StringBuilder propertyBuilder = new StringBuilder(); if (value instanceof Integer) { @@ -492,10 +490,10 @@ } int length = Math.max(1, 20 - property.length()); - OUT.printf(" %" + length + "s ", propertyBuilder.toString()); + sb.append(String.format(" %" + length + "s ", propertyBuilder.toString())); } } - OUT.println(); + OUT.println(sb.toString()); } private static void printProfiling() {