Author: scooter
Date: 2010-09-24 21:48:38 -0700 (Fri, 24 Sep 2010)
New Revision: 22059

Modified:
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/TransClust/de/layclust/taskmanaging/io/Console.java
Log:
Convert to Cytoscape logging for Console too.


Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/TransClust/de/layclust/taskmanaging/io/Console.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/TransClust/de/layclust/taskmanaging/io/Console.java
   2010-09-24 23:54:32 UTC (rev 22058)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/TransClust/de/layclust/taskmanaging/io/Console.java
   2010-09-25 04:48:38 UTC (rev 22059)
@@ -11,9 +11,14 @@
 import java.util.PropertyResourceBundle;
 import java.util.logging.ConsoleHandler;
 import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+// import java.util.logging.Level;
+// import java.util.logging.Logger;
 
+import cytoscape.logger.CyLogger;
+import cytoscape.logger.LogLevel;
+
+import clusterMaker.algorithms.TransClust.TransClustCluster;
+
 import clusterMaker.algorithms.TransClust.de.costmatrixcreation.main.Config;
 import 
clusterMaker.algorithms.TransClust.de.layclust.geometric_clustering.GeometricClusteringConfig;
 import 
clusterMaker.algorithms.TransClust.de.layclust.geometric_clustering.GeometricClusteringFactory;
@@ -35,7 +40,8 @@
  */
 public class Console {
 
-       private static Logger log = Logger.getLogger(Console.class.getName());
+       // private static Logger log = 
Logger.getLogger(Console.class.getName());
+       private static CyLogger log = 
CyLogger.getLogger(TransClustCluster.class);
 
        private String[] args = null;
 
@@ -43,7 +49,7 @@
                        ArgsParseException, IOException {
                this.args = args;
 
-               log.fine("Available processors in system: "
+               log.debug("Available processors in system: "
                                + Runtime.getRuntime().availableProcessors());
 
                parseArgsAndInitProgram();
@@ -68,21 +74,21 @@
                initGivenParameters();
 
                /* set logging */
-               Logger logger = Logger.getLogger("");
-               if (TaskConfig.setLogLevel){
-                       logger.setLevel(TaskConfig.logLevel);
-               }
-               Handler[] handler = logger.getHandlers();
-               for (Handler h : handler) {
-                       if (TaskConfig.setLogLevel){                    
-                               h.setLevel(TaskConfig.logLevel);
-                       }
-                       if (h instanceof ConsoleHandler) {
-                               if (!TaskConfig.verbose) {
-                                       h.setLevel(Level.WARNING);
-                               }
-                       }
-               }
+               // Logger logger = Logger.getLogger("");
+               // if (TaskConfig.setLogLevel){
+               //      logger.setLevel(TaskConfig.logLevel);
+               // }
+               // Handler[] handler = logger.getHandlers();
+               // for (Handler h : handler) {
+               //      if (TaskConfig.setLogLevel){                    
+               //              h.setLevel(TaskConfig.logLevel);
+               //      }
+               //      if (h instanceof ConsoleHandler) {
+               //              if (!TaskConfig.verbose) {
+               //                      h.setLevel(Level.WARNING);
+               //              }
+               //      }
+               // }
 
                if (TaskConfig.gui) {
                        /* start gui with previous set parameters */
@@ -184,7 +190,7 @@
                                TaskConfig.useConfigFile = 
Boolean.parseBoolean(value);
                        } else if (key.equals("-log")) {
                                TaskConfig.setLogLevel = true;
-                               TaskConfig.logLevel = 
Level.parse(value.toUpperCase());
+                               // TaskConfig.logLevel = 
Level.parse(value.toUpperCase());
                        } else if (key.equals("-verbose")) {
                                TaskConfig.verbose = 
Boolean.parseBoolean(value);
                        } else if (key.equals("-info")) {
@@ -422,7 +428,7 @@
                                FileInputStream s = new 
FileInputStream(configPath);
                                PropertyResourceBundle configrb = new 
PropertyResourceBundle(s);
 
-                               log.fine("Using config file " + configPath);
+                               log.debug("Using config file " + configPath);
 
                                TaskConfig.initFromConfigFile(configrb);
                                
FORCEnDLayoutConfig.initFromConfigFile(configrb);
@@ -431,7 +437,7 @@
 
                        } catch (MissingResourceException ex) {
                                log
-                                               .severe("WARNING: Resources are 
missing in the given config file: "
+                                               .error("WARNING: Resources are 
missing in the given config file: "
                                                                + 
TaskConfig.DEFAULTCONFIG
                                                                + ", key="
                                                                + ex.getKey()
@@ -439,12 +445,12 @@
                                                                + 
TaskConfig.DEFAULTCONFIG
                                                                + ". Or these 
parameters do not interest you, because they belong to an unused 
implemtation.");
                        } catch (IOException ex) {
-                               log.severe("ERROR: Unable to read the given 
config file: "
+                               log.fatal("ERROR: Unable to read the given 
config file: "
                                                + configPath);
                                System.exit(-1);
                        } catch (InvalidTypeException ex) {
                                log
-                                               .severe("ERROR: You have 
perhaps given an incorrect class name of an "
+                                               .fatal("ERROR: You have perhaps 
given an incorrect class name of an "
                                                                + 
"implemtation. Please note that this is case sensitive.");
                                System.exit(-1);
                        }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to