You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2004/02/14 04:50:12 UTC

cvs commit: avalon/logging/site/xdocs/api index.xml navigation.xml

mcconnell    2004/02/13 19:50:12

  Modified:    logging/api/src/java/org/apache/avalon/logging/provider
                        LoggingCriteria.java
               logging/logkit/impl/src/java/org/apache/avalon/logging/logkit
                        DefaultLoggingCriteria.java
                        DefaultLoggingFactory.java
               logging/logkit/test/conf logging.xml
               logging  maven.xml project.properties
               logging/site/xdocs/impl navigation.xml
               logging/site/xdocs navigation.xml
  Removed:     logging/site/xdocs/api index.xml navigation.xml
  Log:
  Cleaning up code content and getting more docs in place.
  
  Revision  Changes    Path
  1.3       +16 -23    avalon/logging/api/src/java/org/apache/avalon/logging/provider/LoggingCriteria.java
  
  Index: LoggingCriteria.java
  ===================================================================
  RCS file: /home/cvs/avalon/logging/api/src/java/org/apache/avalon/logging/provider/LoggingCriteria.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LoggingCriteria.java	10 Feb 2004 17:09:18 -0000	1.2
  +++ LoggingCriteria.java	14 Feb 2004 03:50:12 -0000	1.3
  @@ -39,12 +39,6 @@
       //--------------------------------------------------------------
   
      /**
  -    * The logging artifact key.
  -    */
  -    String FACTORY_ARTIFACT_KEY = 
  -      "avalon.logging.factory.artifact";
  -
  -   /**
       * The logging configuration key.
       */
       String LOGGING_CONFIGURATION_KEY = 
  @@ -76,31 +70,36 @@
       //--------------------------------------------------------------
   
      /**
  -    * Set the bootstrap logging channel
  +    * Set the bootstrap logging channel.  The supplied logging
  +    * channel is the logging channel used during the establishment of 
  +    * the logging system. The channel is typically a console logger 
  +    * set to warn or error priority.
  +    *
       * @param logger the boootstrap logging channel
       */
       void setBootstrapLogger( Logger logger );
   
      /**
  -    * Set the base directory for logging resources.
  +    * Set the base directory for logging resources.  The directory 
  +    * serves as the anchor directory for the resolution of filenames
  +    * related to file targets established by the logging system.
  +    *
       * @param dir the base directory
       */
       void setBaseDirectory( File dir );
   
      /**
  -    * Set the artifact referencing the implementation factory.
  -    * @param artifact the implementation artifact
  -    */
  -    void setFactoryArtifact( Artifact artifact );
  -
  -   /**
  -    * Set the logging system configuration
  +    * Set the logging system configuration.  If not set, an 
  +    * implementation of the logging system is required to establish
  +    * a console logging solution as a default logging target.
  +    *
       * @param config the configuration
       */
       void setConfiguration( Configuration config );
   
      /**
  -    * Set the debug enabled policy
  +    * Set the debug enabled policy.  Used to override the all logging
  +    * channel priotities to DEBUG level.  Useful when debuging applications.
       * @param mode TRUE to enabled debug mode else FALSE
       */
       void setDebugEnabled( boolean mode );
  @@ -122,12 +121,6 @@
       * @return the configuration
       */
       Configuration getConfiguration();
  -
  -   /**
  -    * Return the artifact reference to the logging implementation factory .
  -    * @return the logging implementation factory classname 
  -    */
  -    Artifact getFactoryArtifact() throws IOException;
   
      /**
       * Return debug policy.  If TRUE all logging channels will be 
  
  
  
  1.3       +5 -39     avalon/logging/logkit/impl/src/java/org/apache/avalon/logging/logkit/DefaultLoggingCriteria.java
  
  Index: DefaultLoggingCriteria.java
  ===================================================================
  RCS file: /home/cvs/avalon/logging/logkit/impl/src/java/org/apache/avalon/logging/logkit/DefaultLoggingCriteria.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultLoggingCriteria.java	10 Feb 2004 17:09:18 -0000	1.2
  +++ DefaultLoggingCriteria.java	14 Feb 2004 03:50:12 -0000	1.3
  @@ -63,7 +63,7 @@
   
       private static final String IMPLEMENTATION_KEY = "avalon.logging.implementation";
   
  -    private static final String LOGGING_PROPERTIES = "avalon.logging.properties";
  +    private static final String LOGGING_PROPERTIES = "avalon.properties";
   
       private static final Resources REZ =
         ResourceManager.getPackageResources( DefaultLoggingCriteria.class );
  @@ -88,11 +88,7 @@
                 new Boolean( false ) ),
               new LoggerParameter( 
                 LOGGING_BOOTSTRAP_KEY, 
  -              new ConsoleLogger( ConsoleLogger.LEVEL_WARN ) ),
  -            new Parameter( 
  -              FACTORY_ARTIFACT_KEY, 
  -              String.class,
  -              null )
  +              new ConsoleLogger( ConsoleLogger.LEVEL_WARN ) )
           };
       }
   
  @@ -168,15 +164,6 @@
       }
   
      /**
  -    * Set the artifact referencing the implementation factory.
  -    * @param artifact the implementation artifact
  -    */
  -    public void setFactoryArtifact( Artifact artifact )
  -    {
  -        put( FACTORY_ARTIFACT_KEY, artifact );
  -    }
  -
  -   /**
       * Get the bootstrap logging channel
       * @return the boootstrap logging channel
       */
  @@ -208,6 +195,7 @@
       * @return the logging implementation factory classname
       * @exception IllegalStateException if the url is not an artifact url
       */
  +    /*
       public Artifact getFactoryArtifact() throws IOException
       {
           String value = (String) get( FACTORY_ARTIFACT_KEY );
  @@ -220,6 +208,7 @@
               return Artifact.createArtifact( value );
           }
       }
  +    */
   
      /**
       * Return debug policy.  If TRUE all logging channels will be 
  @@ -232,29 +221,6 @@
           Boolean value = (Boolean) get( LOGGING_DEBUG_KEY );
           if( null != value ) return value.booleanValue();
           return false;
  -    }
  -
  -
  -    private static Artifact getDefaultImplementationArtifact( 
  -      InitialContext context )
  -    {
  -        try
  -        {
  -            return DefaultBuilder.createImplementationArtifact( 
  -              DefaultLoggingCriteria.class.getClassLoader(), 
  -              context.getInitialCacheDirectory(),
  -              BASEDIR, 
  -              LOGGING_PROPERTIES, 
  -              IMPLEMENTATION_KEY );
  -        }
  -        catch( Throwable e )
  -        {
  -            final String error = 
  -              REZ.getString( 
  -                "criteria.artifact.default.error", 
  -                BASEDIR, LOGGING_PROPERTIES, IMPLEMENTATION_KEY );
  -            throw new LoggingRuntimeException( error, e );
  -        }
       }
   
       private static File getCanonicalForm( File file )
  
  
  
  1.3       +10 -154   avalon/logging/logkit/impl/src/java/org/apache/avalon/logging/logkit/DefaultLoggingFactory.java
  
  Index: DefaultLoggingFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon/logging/logkit/impl/src/java/org/apache/avalon/logging/logkit/DefaultLoggingFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultLoggingFactory.java	10 Feb 2004 17:09:18 -0000	1.2
  +++ DefaultLoggingFactory.java	14 Feb 2004 03:50:12 -0000	1.3
  @@ -239,7 +239,8 @@
       *    are resolved
       * @param config the log targets configuration
       */
  -    private void setupTargets( final Map factories, final Map targets, final Configuration config )
  +    private void setupTargets( 
  +      final Map factories, final Map targets, final Configuration config )
         throws LoggingException
       {
           Configuration[] children = config.getChildren();
  @@ -249,7 +250,8 @@
               final String id = getTargetId( child );
               try
               {
  -                final LogTarget target = createLogTarget( factories, id, child );
  +                final LogTarget target = 
  +                  createLogTarget( factories, id, child );
                   targets.put( id, target );
                   final String message = 
                     REZ.getString( "target.notice.add", id );
  @@ -272,18 +274,21 @@
       * @return the logging target
       * @exception Exception if an error occurs during factory creation
       */ 
  -    private LogTarget createLogTarget( Map factories, final String id, final Configuration config )
  +    private LogTarget createLogTarget( 
  +      Map factories, final String id, final Configuration config )
         throws LoggingException
       {
           final String key = getTargetFactoryKey( config );
  -        final LogTargetFactory factory = getLogTargetFactory( factories, key );
  +        final LogTargetFactory factory = 
  +          getLogTargetFactory( factories, key );
           return factory.createTarget( config );
       }
   
       private LogTargetFactory getLogTargetFactory( Map factories, String key )
         throws LoggingException
       {
  -        final LogTargetFactory factory = m_factories.getLogTargetFactory( key );
  +        final LogTargetFactory factory = 
  +          m_factories.getLogTargetFactory( key );
           if( factory != null )
           {
               return factory;
  @@ -422,153 +427,4 @@
           final String target = config.getAttribute( "target", null );
           return new CategoryDirective( name, priority, target );
       }
  -
  -    //--------------------------------------------------------------------------
  -    // junk
  -    //--------------------------------------------------------------------------
  -
  -   /**
  -    * Return the identitying key associated with the log target factory.
  -    * @param config the log target factory configuration
  -    * @return the unique key
  -    */
  -    /*
  -    private String getFactoryKey( Configuration config )
  -      throws LoggingException
  -    {
  -        try
  -        {
  -            return config.getAttribute( "type" );
  -        }
  -        catch( ConfigurationException e )
  -        {
  -            final String listing = ConfigurationUtil.list( config );
  -            final String error = 
  -              REZ.getString( 
  -                "target.error.missing-type", 
  -                listing );
  -           throw new LoggingException( error );
  -        }
  -    }
  -    */
  -
  -
  -   /**
  -    * Return the class attribute from a factory element.
  -    * @param config the target factory configuration
  -    * @return the target classname
  -    * @exception LoggingException if the class attribute is not declared
  -    */
  -    /*
  -    private String getFactoryClassname( Configuration config )
  -      throws LoggingException
  -    { 
  -        try
  -        {
  -            return config.getAttribute( "class" );
  -        }
  -        catch( ConfigurationException e )
  -        {
  -            final String listing = ConfigurationUtil.list( config );
  -            final String error = 
  -              REZ.getString( 
  -                "target.error.missing-class", 
  -                listing );
  -            throw new LoggingException( error );
  -        }
  -    }
  -    */
  -
  -   /**
  -    * Load a factory class using a supplied factory classname.
  -    * @param factory the factory classname
  -    * @return the factory class
  -    * @exception LoggingException if a factory class loading error occurs
  -    */
  -    /*
  -    protected Class loadFactoryClass( String classname )
  -        throws LoggingException
  -    {
  -        try
  -        {
  -            return m_classloader.loadClass( classname );
  -        }
  -        catch( ClassNotFoundException e )
  -        {
  -            final String error = 
  -              REZ.getString( 
  -                "target.error.class-not-found", 
  -                classname );
  -            throw new LoggingException( error, e );
  -        }
  -        catch( Throwable e )
  -        {
  -            final String error = 
  -              REZ.getString( 
  -                "target.error.class-load", 
  -                classname );
  -            throw new LoggingException( error, e );
  -        }
  -    }
  -    */
  -
  -   /**
  -    * Create a new logging target factory instance.
  -    */
  -    /*
  -    private LogTargetFactory createLogTargetFactory( Configuration config ) 
  -      throws LoggingException
  -    {
  -        String classname = getFactoryClassname( config );
  -        Class clazz = loadFactoryClass( classname );
  -        return buildLogTargetFactoryViaConstructor( clazz );
  -    }
  -    */
  -
  -    /**
  -     * Create the log target factories.
  -     *
  -     * @param config the factory configuration element.
  -     * @throws LoggingException if an error occurs in factor directive parsing
  -     */
  -    /*
  -    private void setupTargetFactories( 
  -      final Map factories, final Configuration config )
  -      throws LoggingException
  -    {
  -        Configuration[] children = config.getChildren();
  -        for( int i = 0; i < children.length; i++ )
  -        {
  -            Configuration child = children[i];
  -            if( child.getName().equalsIgnoreCase( "factory" ) )
  -            {
  -                final String key = getFactoryKey( child );
  -                try
  -                {
  -                    LogTargetFactory factory =
  -                      createLogTargetFactory( child );
  -                    factories.put( key, factory );
  -                }
  -                catch( LoggingException e )
  -                {
  -                    final String error = 
  -                     REZ.getString( "factory.target-factory.load.error", key );
  -                    m_logger.error( error, e );
  -                }
  -            }
  -            else
  -            {
  -                final String name = child.getName();
  -                final String listing = ConfigurationUtil.list( child ); 
  -                final String error = 
  -                  REZ.getString( 
  -                    "factory.target-factory.unknown-element", 
  -                    name, 
  -                    listing );
  -                m_logger.error( error );
  -            }
  -        }
  -    }
  -    */
  -
   }
  
  
  
  1.2       +1 -1      avalon/logging/logkit/test/conf/logging.xml
  
  Index: logging.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/logkit/test/conf/logging.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- logging.xml	4 Feb 2004 20:49:12 -0000	1.1
  +++ logging.xml	14 Feb 2004 03:50:12 -0000	1.2
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
   
  -<logging debug="true">
  +<logging debug="false">
   
     <!--
     Declaration of a set of logging targets.
  
  
  
  1.2       +4 -1      avalon/logging/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/maven.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- maven.xml	4 Feb 2004 20:48:48 -0000	1.1
  +++ maven.xml	14 Feb 2004 03:50:12 -0000	1.2
  @@ -47,7 +47,6 @@
   
     <ant:property name="pom.specificationVersion" value="1.0"/>
     <ant:property name="pom.organization.identifier" value="ASF"/>
  -  <ant:property name="maven.docs.src" value="${basedir}/site/xdocs"/>
     <ant:property file="project.properties"/>
   
     <!--
  @@ -365,6 +364,10 @@
   	  </classpath>
   
   	  <link href="http://java.sun.com/j2se/1.4.2/docs/api/" />
  +	  <link href="http://avalon.apache.org/util/api/" />
  +	  <link href="http://avalon.apache.org/logkit/api/" />
  +	  <link href="http://avalon.apache.org/repository/api/" />
  +	  <link href="http://avalon.apache.org/framework/api/" />
   
       </ant:javadoc>
     </goal>
  
  
  
  1.2       +1 -11     avalon/logging/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/avalon/logging/project.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.properties	4 Feb 2004 20:48:48 -0000	1.1
  +++ project.properties	14 Feb 2004 03:50:12 -0000	1.2
  @@ -8,14 +8,4 @@
   maven.xdoc.jsl = ./site/etc/site.jsl
   maven.javadoc.stylesheet =${basedir}/site/etc/stylesheet.css
   maven.xdoc.poweredby.image =
  -
  -#
  -# Declaration of the remote links to assign on javadoc generation.
  -# Link declarations can be overriden in the user's build.properties
  -# file.
  -#
  -
  -sun.j2se.link = http://java.sun.com/j2ee/1.4/docs/api/
  -avalon.util.link = http://avalon.apache.org/util/api/
  -maven.javadoc.links = ${sun.j2se.link},${avalon.util.link}
  -
  +maven.docs.src = ${basedir}/site/xdocs
  
  
  
  1.3       +1 -1      avalon/logging/site/xdocs/impl/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/site/xdocs/impl/navigation.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- navigation.xml	13 Feb 2004 10:25:45 -0000	1.2
  +++ navigation.xml	14 Feb 2004 03:50:12 -0000	1.3
  @@ -33,7 +33,7 @@
   
       <menu name="About Avalon Logging">
         <item name="Overview" href="/index.html"/>
  -      <item name="Specification" href="/api/index.html"/>
  +      <item name="Specification" href="/spec/index.html"/>
         <item name="Implementations" href="/impl/index.html">
           <item name="LogKit" href="/impl/logkit/index.html"/>
         </item>
  
  
  
  1.3       +1 -1      avalon/logging/site/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/site/xdocs/navigation.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- navigation.xml	13 Feb 2004 10:25:44 -0000	1.2
  +++ navigation.xml	14 Feb 2004 03:50:12 -0000	1.3
  @@ -33,7 +33,7 @@
   
       <menu name="About Avalon Logging">
         <item name="Overview" href="/index.html"/>
  -      <item name="Specification" href="/api/index.html"/>
  +      <item name="Specification" href="/spec/index.html"/>
         <item name="Implementations" href="/impl/index.html"/>
       </menu>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org