geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r410412 - /geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Date Wed, 31 May 2006 00:49:26 GMT
Author: jdillon
Date: Tue May 30 17:49:25 2006
New Revision: 410412

URL: http://svn.apache.org/viewvc?rev=410412&view=rev
Log:
More debug, guard them too

Modified:
    geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java

Modified: geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=410412&r1=410411&r2=410412&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Tue May 30 17:49:25 2006
@@ -190,6 +190,7 @@
     private void execute(final String[] args) throws Exception {
         // Its okay to use logging now
         Log log = LogFactory.getLog(Main.class);
+        boolean debug = log.isDebugEnabled();
 
         //
         // TODO: Need to pass GShell the ClassWorld, so that the application can add to it
if needed
@@ -207,11 +208,26 @@
         // TEMP: Log some info about the terminal
         //
 
-        Terminal term = Terminal.setupTerminal();
-        log.debug("Using terminal: " + term);
-        log.debug("Using STDIN: " + System.in);
+        if (debug) {
+            log.debug("Using STDIN: " + System.in);
+            log.debug("Using STDOUT: " + System.out);
+            log.debug("Using STDERR: " + System.err);
+        }
+
+        Terminal term = Terminal.getTerminal();
 
-        log.debug("Started in " + watch);
+        if (debug) {
+            log.debug("Using terminal: " + term);
+            log.debug("  supported: " + term.isSupported());
+            log.debug("  height: " + term.getTerminalHeight());
+            log.debug("  width: " + term.getTerminalWidth());
+            log.debug("  echo: " + term.getEcho());
+            log.debug("  ANSI: " + term.isANSISupported());
+        }
+
+        if (debug) {
+            log.debug("Started in " + watch);
+        }
 
         if (interactive) {
             //
@@ -252,12 +268,16 @@
         else {
             int status = gshell.execute(args);
 
-            log.debug("Ran for " + watch);
+            if (debug) {
+                log.debug("Ran for " + watch);
+            }
 
             System.exit(status);
         }
 
-        log.debug("Ran for " + watch);
+        if (debug) {
+            log.debug("Ran for " + watch);
+        }
     }
 
     public static void main(final String[] args, final ClassWorld world) throws Exception
{



Mime
View raw message