LISTSERV mailing list manager LISTSERV 16.5

Help for LCDET-SVN Archives


LCDET-SVN Archives

LCDET-SVN Archives


LCDET-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

LCDET-SVN Home

LCDET-SVN Home

LCDET-SVN  February 2015

LCDET-SVN February 2015

Subject:

r3528 - /projects/lcsim/trunk/event-processing/src/main/java/org/lcsim/util/Driver.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the lcdet svn repository <[log in to unmask]>

Date:

Wed, 11 Feb 2015 21:55:37 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (115 lines)

Author: [log in to unmask]
Date: Wed Feb 11 13:55:33 2015
New Revision: 3528

Log:
Simply Driver logging so it is not hierarchical.  Existing logging with single Logger object does not work correctly.

Modified:
    projects/lcsim/trunk/event-processing/src/main/java/org/lcsim/util/Driver.java

Modified: projects/lcsim/trunk/event-processing/src/main/java/org/lcsim/util/Driver.java
 =============================================================================
--- projects/lcsim/trunk/event-processing/src/main/java/org/lcsim/util/Driver.java	(original)
+++ projects/lcsim/trunk/event-processing/src/main/java/org/lcsim/util/Driver.java	Wed Feb 11 13:55:33 2015
@@ -1,31 +1,29 @@
 package org.lcsim.util;
 
 import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
-import java.util.logging.Formatter;
 import java.util.logging.Level;
-import java.util.logging.LogRecord;
 import java.util.logging.Logger;
-import java.util.logging.StreamHandler;
+
 import org.lcsim.conditions.ConditionsManager;
 import org.lcsim.event.EventHeader;
 import org.lcsim.geometry.Detector;
 
 /**
- * A driver is a steering routine which can deal with event processing, and/or call any number of child drivers. When used as a child driver all parameters such as histogramLevel and logger are
- * inherited from the parent driver.
+ * A driver is a steering routine which can deal with event processing, and/or call any number of child drivers. 
+ * When used as a child driver all parameters such as histogramLevel and logger are inherited from the parent driver.
  * <p>
- * It also allows controlling the histogram level of the processors being called and handles coordination of random numbers between Monte Carlo processors.
+ * It also allows controlling the histogram level of the processors being called and handles coordination of random numbers 
+ * between Monte Carlo processors.
  *
  * @author Tony Johnson
  * @version $Id: Driver.java,v 1.14 2007/09/11 00:21:00 tonyj Exp $
  */
 
 public class Driver {
+    
     // We dont use an enum, because we want to be able to test for level>some value.
     // and because drivers can use special values for special purposes.
     public final static int HLEVEL_DEFAULT = -1;
@@ -172,8 +170,9 @@
     }
 
     /**
-     * Called by the framework to process an event. Don't forget to call <code>super.process(event)</code> to cause the child processes to be executed. In addition the process event can call throw
-     * some special exceptions:
+     * Called by the framework to process an event. 
+     * Don't forget to call <code>super.process(event)</code> to cause the child processes to be executed. 
+     * In addition the process event call can throw some special exceptions:
      * <ul>
      * <li>NextEventException - aborts further processing of this event</li>
      * <li>StopRunException - causes event processing to be stopped</li>
@@ -295,11 +294,6 @@
 
         MotherOfAllDrivers() {
             super("TOP");
-            StreamHandler handler = new StreamHandler(System.out, new DriverFormatter());
-            handler.setLevel(Level.ALL);
-            getLogger().setUseParentHandlers(false);
-            getLogger().addHandler(handler);
-            getLogger().setLevel(Level.WARNING);
         }
 
         public Random getRandom() {
@@ -318,30 +312,7 @@
             return getName();
         }
     }
-
-    private static class DriverFormatter extends Formatter {
-        public synchronized String format(LogRecord record) {
-            StringBuilder sb = new StringBuilder();
-            sb.append(record.getLoggerName().substring("TOP".length() + 1));
-            sb.append(": ");
-            sb.append(record.getLevel().getLocalizedName());
-            sb.append(": ");
-            sb.append(formatMessage(record));
-            sb.append('\n');
-            if (record.getThrown() != null) {
-                try {
-                    StringWriter sw = new StringWriter();
-                    PrintWriter pw = new PrintWriter(sw);
-                    record.getThrown().printStackTrace(pw);
-                    pw.close();
-                    sb.append(sw.toString());
-                } catch (Exception ex) {
-                }
-            }
-            return sb.toString();
-        }
-    }
-
+   
     /**
      * If thrown during the process method of a driver, causes processing of the current event to be aborted. Event procssing skips immediately to the next event.
      */

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use