# HG changeset patch # User Bernhard Urban # Date 1375376328 -7200 # Node ID 01a0f525ac177d48c3dd51d96928c03d44f379f8 # Parent 1d1675f18e8524a489e16164bb44a6de30892b74 Debug: add printf i.e., log without newline diff -r 1d1675f18e85 -r 01a0f525ac17 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Thu Aug 01 17:24:41 2013 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Thu Aug 01 18:58:48 2013 +0200 @@ -164,6 +164,12 @@ } } + public static void printf(String msg, Object... args) { + if (ENABLED && DebugScope.getInstance().isLogEnabled()) { + DebugScope.getInstance().printf(msg, args); + } + } + public static void dump(Object object, String msg, Object... args) { if (ENABLED && DebugScope.getInstance().isDumpEnabled()) { DebugScope.getInstance().dump(object, msg, args); diff -r 1d1675f18e85 -r 01a0f525ac17 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java Thu Aug 01 17:24:41 2013 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java Thu Aug 01 18:58:48 2013 +0200 @@ -114,6 +114,16 @@ } } + public void printf(String msg, Object... args) { + if (isLogEnabled()) { + if (lastLogScope.get() == null || !lastLogScope.get().qualifiedName.equals(this.qualifiedName)) { + output.println("scope: " + qualifiedName); + lastLogScope.set(this); + } + output.printf(msg, args); + } + } + public void dump(Object object, String formatString, Object[] args) { if (isDumpEnabled()) { DebugConfig config = getConfig();