geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r574505 - /geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
Date Tue, 11 Sep 2007 08:24:39 GMT
Author: jdillon
Date: Tue Sep 11 01:24:36 2007
New Revision: 574505

URL: http://svn.apache.org/viewvc?rev=574505&view=rev
Log:
(GSHELL-6) Add output 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=574505&r1=574504&r2=574505&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 11 01:24:36 2007
@@ -27,6 +27,7 @@
 import java.io.Reader;
 
 import org.apache.geronimo.gshell.ansi.RenderWriter;
+import org.slf4j.helpers.MessageFormatter;
 
 /**
  * Container for input/output handles.
@@ -206,6 +207,50 @@
     }
 
     //
-    // TODO: Add vararg-based helpers to make dealing with verbosity levels easier on developers
+    // Output Helpers
     //
+
+    public void debug(final String msg) {
+        if (isDebug()) {
+            out.println(msg);
+        }
+    }
+
+    public void debug(final String format, final Object... args) {
+        if (isDebug()) {
+            out.println(MessageFormatter.arrayFormat(format, args));
+        }
+    }
+
+    public void info(final String msg) {
+        if (!isQuiet()) {
+            out.println(msg);
+        }
+    }
+
+    public void info(final String format, final Object... args) {
+        if (!isQuiet()) {
+            out.println(MessageFormatter.arrayFormat(format, args));
+        }
+    }
+
+    public void warn(final String msg) {
+        if (!isQuiet()) {
+            err.println(msg);
+        }
+    }
+
+    public void warn(final String format, final Object... args) {
+        if (!isQuiet()) {
+            err.println(MessageFormatter.arrayFormat(format, args));
+        }
+    }
+
+    public void error(final String msg) {
+        err.println(msg);
+    }
+
+    public void error(final String format, final Object... args) {
+        err.println(MessageFormatter.arrayFormat(format, args));
+    }
 }



Mime
View raw message