/[classpath]/classpath/java/util/logging/LogManager.java
ViewVC logotype

Diff of /classpath/java/util/logging/LogManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by tromey, Tue Dec 31 22:28:02 2002 UTC revision 1.7 by iproetel, Tue Aug 12 09:46:31 2003 UTC
# Line 52  import java.util.Properties; Line 52  import java.util.Properties;
52  import java.util.Enumeration;  import java.util.Enumeration;
53  import java.util.Iterator;  import java.util.Iterator;
54  import java.util.Map;  import java.util.Map;
55    import java.util.StringTokenizer;
56  import java.lang.ref.WeakReference;  import java.lang.ref.WeakReference;
57    
58  /**  /**
# Line 167  public class LogManager Line 168  public class LogManager
168       * the order in which classes are initialized.       * the order in which classes are initialized.
169       */       */
170      Logger.getLogger("global").setParent(rootLogger);      Logger.getLogger("global").setParent(rootLogger);
171        Logger.getLogger("global").setUseParentHandlers(true);
172    }    }
173    
174    
# Line 520  public class LogManager Line 522  public class LogManager
522    
523    public synchronized void readConfiguration(InputStream inputStream)    public synchronized void readConfiguration(InputStream inputStream)
524      throws IOException, SecurityException      throws IOException, SecurityException
525    {    {    
526      Properties   newProperties;      Properties   newProperties;
527      Enumeration  keys;      Enumeration  keys;
528    
# Line 532  public class LogManager Line 534  public class LogManager
534    
535      while (keys.hasMoreElements())      while (keys.hasMoreElements())
536      {      {
537        String key = (String) keys.nextElement();        String key = ((String) keys.nextElement()).trim();
538        String value = newProperties.getProperty(key);        String value = newProperties.getProperty(key);
539      
540        if (value == null)        if (value == null)
541          continue;          continue;
542            
543              value = value.trim();
544            
545              if("handlers".equals(key))
546            {
547              StringTokenizer tokenizer = new StringTokenizer(value);
548              while(tokenizer.hasMoreTokens())
549                {
550                  String handlerName = tokenizer.nextToken();      
551                  try
552                    {
553                      Class handlerClass = Class.forName(handlerName);
554                      getLogger("").addHandler((Handler)handlerClass.newInstance());
555                    }
556                  catch (ClassCastException ex)
557                    {
558                      System.err.println("[LogManager] class " + handlerName + " is not subclass of java.util.logging.Handler");
559                    }
560                  catch (Exception ex)
561                    {
562                      //System.out.println("[LogManager.readConfiguration]"+ex);
563                    }
564                }
565            }
566              
567        if (key.endsWith(".level"))        if (key.endsWith(".level"))
568        {        {
569          String loggerName = key.substring(0, key.length() - 6);          String loggerName = key.substring(0, key.length() - 6);
# Line 550  public class LogManager Line 576  public class LogManager
576            }            }
577            catch (Exception _)            catch (Exception _)
578            {            {
579            //System.out.println("[LogManager.readConfiguration] "+_);
580            }            }
581            continue;            continue;
582          }          }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26