Mercurial > hg > truffle
changeset 18875:d71bf1009d71
Fix indentation of multi-line strings passed to Debug.log
author | Paul Woegerer <paul.woegerer@oracle.com> |
---|---|
date | Fri, 16 Jan 2015 14:24:04 +0100 |
parents | e847e842ce93 |
children | c446d00f2cdf |
files | graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java Fri Jan 16 16:01:31 2015 +0100 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java Fri Jan 16 14:24:04 2015 +0100 @@ -57,12 +57,10 @@ StringBuilder str = new StringBuilder(); printScopeName(str); str.append(indent); - if (args.length == 0) { - str.append(msg); - } else { - str.append(String.format(msg, args)); - } - str.append(System.lineSeparator()); + String result = args.length == 0 ? msg : String.format(msg, args); + String lineSep = System.lineSeparator(); + str.append(result.replace(lineSep, lineSep.concat(indent))); + str.append(lineSep); output.append(str); lastUsedIndent = this; }