geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r576842 - /geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
Date Tue, 18 Sep 2007 11:18:12 GMT
Author: jdillon
Date: Tue Sep 18 04:18:12 2007
New Revision: 576842

URL: http://svn.apache.org/viewvc?rev=576842&view=rev
Log:
Add toString(), add verbose() helpers

Modified:
    geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java

Modified: geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java?rev=576842&r1=576841&r2=576842&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
Tue Sep 18 04:18:12 2007
@@ -27,6 +27,7 @@
 import java.io.Reader;
 
 import org.apache.geronimo.gshell.ansi.RenderWriter;
+import org.apache.geronimo.gshell.common.tostring.ReflectionToStringBuilder;
 import org.slf4j.helpers.MessageFormatter;
 import org.codehaus.plexus.util.IOUtil;
 
@@ -126,6 +127,10 @@
         this(System.in, System.out, System.err);
     }
 
+    public String toString() {
+        return ReflectionToStringBuilder.toString(this);
+    }
+    
     /**
      * Set the verbosity level.
      *
@@ -231,6 +236,18 @@
 
     public void info(final String format, final Object... args) {
         if (!isQuiet()) {
+            out.println(MessageFormatter.arrayFormat(format, args));
+        }
+    }
+
+    public void verbose(final String msg) {
+        if (isVerbose()) {
+            out.println(msg);
+        }
+    }
+
+    public void verbose(final String format, final Object... args) {
+        if (isVerbose()) {
             out.println(MessageFormatter.arrayFormat(format, args));
         }
     }



Mime
View raw message