You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by we...@locus.apache.org on 2000/09/13 22:28:49 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

werken      00/09/13 13:28:47

  Added:       src/java/org/apache/velocity/log Log.java LogHandle.java
                        LogImpl.java Test.java
  Log:
  Integrating logging subsystem donated by the kind folks
  at ifleet.com.
  
  Submitted by: james ce johnson (jcej@ifleet.com)
  
  Revision  Changes    Path
  1.1                  jakarta-velocity/src/java/org/apache/velocity/log/Log.java
  
  Index: Log.java
  ===================================================================
  /* ====================================================================
   * Copyright (c) iFleet, Inc.  All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. All advertising materials mentioning features or use of this
   *    software must display the following acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * 4. The names "Apache Server" and "Apache Group" must not be used to
   *    endorse or promote products derived from this software without
   *    prior written permission. For written permission, please contact
   *    apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 6. Redistributions of any form whatsoever must retain the following
   *    acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
   * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Group and was originally based
   * on public domain software written at the National Center for
   * Supercomputing Applications, University of Illinois, Urbana-Champaign.
   * For more information on the Apache Group and the Apache HTTP server
   * project, please see <http://www.apache.org/>.
   *
   */
  
  package org.apache.velocity.log;
  
  import java.io.*;
  import java.text.*;
  import java.util.*;
  
  /**
     <p>This class represents a logfile on disk.  Actual logging
     is performed using {@link org.apache.velocity.LogHandle}
     instances.
  
     @author bob mcwhirter (bob@werken.com)
     @author James CE Johnson (jcej@tragus.org)
     @author Jim Crossley (jcrossly@ifleet.com)
     @author John Quinn (jquinn@ifleet.com)
     @author Keith SChnabble
  
     @see org.apache.velocity.LogHandle
  */
  public interface Log
  {
    /** Retrieve a LogHandler from this Log matching
        the identifier
  
        @param identifier String to tag message with
        @return The handle used for logging with the identifier
    */
    LogHandle getHandle(String identifier);
  
    /** Set the target of this Log
  
        @param logfile Filename of the logfile
    */
    void setTarget(String logfile) throws IOException;
  
    /** Set the target of this Log
  
        @param target Output sink for log messages
    */
    void setTarget(PrintWriter target);
  
    /** <p>Log an informative message
  
        @param logMessage The message to log
    */
    void info(String identifier,Object logMessage);
  
    /** <p>Log a warning message
  
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    void warning(String identifier, Object logMessage);
  
    /** <p>Log an error message
        
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    void error(String identifier,Object logMessage);
  
    /** <p>Log an exception (with stacktrace)
        
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    void exception(String identifier, Object logMessage);
  
    /** <p>Log a debug message
        
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    void debug(String identifier,Object logMessage);
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/log/LogHandle.java
  
  Index: LogHandle.java
  ===================================================================
  /* ====================================================================
   * Copyright (c) iFleet, Inc.  All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. All advertising materials mentioning features or use of this
   *    software must display the following acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * 4. The names "Apache Server" and "Apache Group" must not be used to
   *    endorse or promote products derived from this software without
   *    prior written permission. For written permission, please contact
   *    apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 6. Redistributions of any form whatsoever must retain the following
   *    acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
   * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Group and was originally based
   * on public domain software written at the National Center for
   * Supercomputing Applications, University of Illinois, Urbana-Champaign.
   * For more information on the Apache Group and the Apache HTTP server
   * project, please see <http://www.apache.org/>.
   *
   */
  
  package org.apache.velocity.log;
  
  /**
     <p>Handle connected to a {@link org.apache.velocity.Log}
     to provide identified logging.
  
     <p>Typically, a LogHandle should be retrieved from the
     owning Log object.  A common usage pattern is for each
     class to contain a static instance of LogHandle, and use
     the package/classname as the identifier.
  */
  
  public class LogHandle implements java.io.Serializable
  {
    public static final int _infoMask = 1;
    public static final int _warningMask = 2;
    public static final int _errorMask = 4;
    public static final int _exceptionMask = 8;
    public static final int _debugMask = 16;
    public static final int _noneMask = 0;
    public static final int _allMask = 255;
  
    /** Mask dictating what gets logged */
    private int         _mask = _allMask;
  
    /** Parent 'owning' Log */
    private Log         _log = null;
  
    /** Identifier used during loggin */
    private String      _identifier = null;
  
    /** <p>Construct a LogHandle linked to a particular
        Log, and tagged with an identifier.
  
        @param log The log to delegate to
        @param identifier The identifier to identify what's getting logged
    */
    
    LogHandle(Log log,
              String identifier)
    {
      _log = log;
      _identifier = identifier;
    }
  
    /** <p>Set the mask to determine what actually gets logged
        through this handle.
  
        @param mask The bitmask
    */
    public void setMask (int mask)
    {
  	_mask = mask;
    }
  
    /** <p>Retrieve the current bitmask
  
        @return bitmask
     */
    public int getMask ()
    {
  	return _mask;
    }
  
    /** <p>Log an informative message
  
        @param logMessage The message to log
    */
    public void info(Object logMessage)
    {
      if ((_mask & _infoMask) != 0)
        _log.info(_identifier,
                  logMessage);
    }
  
    /** <p>Log a warning message
  
        @param logMessage The message to log
    */
    public void warning(Object logMessage)
    {
      if ((_mask & _warningMask) != 0)
        _log.warning(_identifier,
                     logMessage);
    }
  
    /** <p>Log an error message
  
        @param logMessage The message to log
    */
    public void error(Object logMessage)
    {
      if ((_mask & _errorMask) != 0)
        _log.error(_identifier,
                   logMessage);
    }
  
    /** <p>Log an exception (with stacktrace)
  
        @param logMessage The message to log
    */
    public void exception(Object logMessage)
    {
      if ((_mask & _exceptionMask) != 0)
        _log.exception(_identifier,
                       logMessage);
    }
      
    /** <p>Log a debug message
  
        @param logMessage The message to log
    */
    public void debug(Object logMessage)
    {
      if ((_mask & _debugMask) != 0)
        _log.debug(_identifier,
                   logMessage);
    }
  
  
  }
  
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/log/LogImpl.java
  
  Index: LogImpl.java
  ===================================================================
  /* ====================================================================
   * Copyright (c) iFleet, Inc.  All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. All advertising materials mentioning features or use of this
   *    software must display the following acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * 4. The names "Apache Server" and "Apache Group" must not be used to
   *    endorse or promote products derived from this software without
   *    prior written permission. For written permission, please contact
   *    apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 6. Redistributions of any form whatsoever must retain the following
   *    acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
   * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Group and was originally based
   * on public domain software written at the National Center for
   * Supercomputing Applications, University of Illinois, Urbana-Champaign.
   * For more information on the Apache Group and the Apache HTTP server
   * project, please see <http://www.apache.org/>.
   *
   */
  
  package org.apache.velocity.log;
  
  import java.io.*;
  import java.text.*;
  import java.util.*;
  
  
  /**
     <p>Implementation of the Log interface to provide concrete
     logging facilities
  
     <p>Logs thread-id, date, identifier, message, and stack-trace
     if logging an exception.
  */
  
  public class LogImpl implements Log
  {
    /** Format for date logging */
    static private DateFormat dateFmt = DateFormat.getDateTimeInstance(DateFormat.SHORT,
                                                                       DateFormat.SHORT); 
  
    /** Target for this log */
    private PrintWriter _target  = null;
  
    /** Cache of handles (by identifier) */
    private Hashtable   _handles = new Hashtable();
  
    /** Flag dictating if anything gets logged */
    private boolean quiet_ = (System.getProperty("log.quiet") != null);
      
    public LogImpl()
    {
      // intentionally left blank
    }
  
    /** Retrieve a LogHandler from this Log matching
        the identifier
  
        @param identifier String to tag message with
        @return The handle used for logging with the identifier
    */
    public synchronized LogHandle getHandle(String identifier)
    {
      LogHandle handle = (LogHandle) _handles.get(identifier);
        
      if (handle == null)
      {
        handle = new LogHandle(this,
                               identifier);
        _handles.put(identifier, handle);
      }
      return handle;
    }
  
    /** Set the target of this Log
  
        If the target is null, then System.err. is used.
        
        @param logfile Filename of the logfile
    */
    public void setTarget(String logfile) throws IOException
  
    {
      PrintWriter out;
  
      if (logfile != null)
      {
        out = new PrintWriter(new FileWriter(logfile,true));
      }
      else
      {
        out = new PrintWriter(new OutputStreamWriter(System.err));
      }
  
      setTarget(out);
  
      out.flush();
    }
    
    /** Set the target of this Log
  
        If the target is null, then System.err is used.
  
        @param target Output sink for log messages
    */
    public void setTarget(PrintWriter target) { 
  
      if (target == null)
      {
        target = new PrintWriter(new OutputStreamWriter(System.err));
      }
  
      _target = target;
      _target.println("------- LOG BEGINS [" + dateFmt.format(new Date()) + "] -------");
    }
   
    private void writeln(String level,
                         String type,
                         Object message)
    {
      if (!quiet_) {
        write(level,
              type,
              message);
        _target.println();
        _target.flush();
      }
    }
      
  
    private synchronized void write(String level,
                                    String type,
                                    Object message)
    {
      try
      {
        _target.print( new java.sql.Timestamp(System.currentTimeMillis())
          + "|" + Thread.currentThread().hashCode()
                       + "|" + level
                       + "|" + type 
                       + ": " + message); 
      }
      catch (java.lang.Exception e)
      {
        System.err.println("** COULD NOT WRITE LOG! SWITCHING TO STDERR **");
        System.err.println(dateFmt.format(new Date()) 
                           + "\t" + level + "\t" + message);
        System.err.flush();
        setTarget(new PrintWriter(System.err));
      }
    }
  
    /** <p>Log an informative message
  
        @param logMessage The message to log
    */
    public void info(String identifier,
                     Object logMessage)
    {
      writeln("INFO",
              identifier,
              logMessage);
    }
  
    /** <p>Log a warning message
  
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    public void warning(String identifier,
                        Object logMessage)
    {
      writeln("WARN",
              identifier,
              logMessage);
    }
  
    /** <p>Log an error message
        
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    public void error(String identifier,
                      Object logMessage)
    {
      writeln("ERROR",
              identifier,
              logMessage);
    }
    
    /** <p>Log an exception (with stacktrace)
        
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    public void exception(String identifier,
                          Object logMessage)
    {
      if (logMessage instanceof Exception) {
        Exception e = (Exception) logMessage;
        write("EXCPT",
              identifier,
              "");
        e.printStackTrace(_target); 
        _target.flush();
      }  else {
        writeln("EXCPT",
                identifier,
                logMessage);
      }
    }
  
    /** <p>Log a debug message
        
        @param identifier Identifying tag for message
        @param logMessage The message to log
    */
    public void debug(String identifier,
                      Object logMessage)
    {
      writeln("DEBUG",
              identifier,
              logMessage);
    }
  
  
  
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/log/Test.java
  
  Index: Test.java
  ===================================================================
  
  package org.apache.velocity.log;
  
  public class Test
  {
  	protected LogHandle _log =
  		Engine.getLogHandle("Foo");
  
  	public void bar()
  	{
  		_log.info("bar() called");
  	}
  
      public static void main( String [] argv )
      {
          Test t = new Test();
          t.bar();
      }
  }
  
  
  class Engine
  {
  	public static String LOGFILE = "./test.log";
  	protected static LogImpl _logImplementation = null;
  
  	public static LogHandle getLogHandle( String id )
  	{
          if( _logImplementation == null )
              initialize();
          return _logImplementation.getHandle(id);
  	}
  
      private static synchronized void initialize()
      {
          try
          {
              if( _logImplementation == null )
              {
                  _logImplementation = new LogImpl();
                  _logImplementation.setTarget( LOGFILE );
              }
          }
          catch( java.io.IOException e )
          {
              e.printStackTrace();
          }
      }
      
  }
  
  
  

Re: Log stuff

Posted by "Daniel L. Rall" <dl...@collab.net>.
bob wrote:
> 
> On Wed, 13 Sep 2000, Daniel L. Rall wrote:
> 
> > Thanks Bob!  Any chance of making this coding conventions compliant?
> 
> Yah.  I'm kinda working on it in phases.  I originally got it
> bare without javadocs, so I managed to squeeze those in, at least.
> 
> Will tweak curlies and variable names Real Soon.

Heh, you rock man.  No rush.  :)
-- 

Daniel Rall <dl...@collab.net>
http://collab.net/ | open source | do the right thing

re: Log stuff

Posted by bob <bo...@accurev.com>.
On Wed, 13 Sep 2000, Daniel L. Rall wrote:

> Thanks Bob!  Any chance of making this coding conventions compliant?

Yah.  I'm kinda working on it in phases.  I originally got it
bare without javadocs, so I managed to squeeze those in, at least.

Will tweak curlies and variable names Real Soon.

	-bob


Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by "Daniel L. Rall" <dl...@collab.net>.
Thanks Bob!  Any chance of making this coding conventions compliant?

werken@locus.apache.org wrote:
> 
> werken      00/09/13 13:28:47
> 
>   Added:       src/java/org/apache/velocity/log Log.java LogHandle.java
>                         LogImpl.java Test.java
>   Log:
>   Integrating logging subsystem donated by the kind folks
>   at ifleet.com.
> 
>   Submitted by: james ce johnson (jcej@ifleet.com)
> 
>   Revision  Changes    Path
>   1.1                  jakarta-velocity/src/java/org/apache/velocity/log/Log.java
> 
>   Index: Log.java
>   ===================================================================
>   /* ====================================================================
>    * Copyright (c) iFleet, Inc.  All rights reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. All advertising materials mentioning features or use of this
>    *    software must display the following acknowledgment:
>    *    "This product includes software developed by the Apache Group
>    *    for use in the Apache HTTP server project (http://www.apache.org/)."
>    *
>    * 4. The names "Apache Server" and "Apache Group" must not be used to
>    *    endorse or promote products derived from this software without
>    *    prior written permission. For written permission, please contact
>    *    apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache"
>    *    nor may "Apache" appear in their names without prior written
>    *    permission of the Apache Group.
>    *
>    * 6. Redistributions of any form whatsoever must retain the following
>    *    acknowledgment:
>    *    "This product includes software developed by the Apache Group
>    *    for use in the Apache HTTP server project (http://www.apache.org/)."
>    *
>    * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
>    * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
>    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
>    * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
>    * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
>    * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>    * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
>    * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
>    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
>    * OF THE POSSIBILITY OF SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Group and was originally based
>    * on public domain software written at the National Center for
>    * Supercomputing Applications, University of Illinois, Urbana-Champaign.
>    * For more information on the Apache Group and the Apache HTTP server
>    * project, please see <http://www.apache.org/>.
>    *
>    */
> 
>   package org.apache.velocity.log;
> 
>   import java.io.*;
>   import java.text.*;
>   import java.util.*;
> 
>   /**
>      <p>This class represents a logfile on disk.  Actual logging
>      is performed using {@link org.apache.velocity.LogHandle}
>      instances.
> 
>      @author bob mcwhirter (bob@werken.com)
>      @author James CE Johnson (jcej@tragus.org)
>      @author Jim Crossley (jcrossly@ifleet.com)
>      @author John Quinn (jquinn@ifleet.com)
>      @author Keith SChnabble
> 
>      @see org.apache.velocity.LogHandle
>   */
>   public interface Log
>   {
>     /** Retrieve a LogHandler from this Log matching
>         the identifier
> 
>         @param identifier String to tag message with
>         @return The handle used for logging with the identifier
>     */
>     LogHandle getHandle(String identifier);
> 
>     /** Set the target of this Log
> 
>         @param logfile Filename of the logfile
>     */
>     void setTarget(String logfile) throws IOException;
> 
>     /** Set the target of this Log
> 
>         @param target Output sink for log messages
>     */
>     void setTarget(PrintWriter target);
> 
>     /** <p>Log an informative message
> 
>         @param logMessage The message to log
>     */
>     void info(String identifier,Object logMessage);
> 
>     /** <p>Log a warning message
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     void warning(String identifier, Object logMessage);
> 
>     /** <p>Log an error message
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     void error(String identifier,Object logMessage);
> 
>     /** <p>Log an exception (with stacktrace)
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     void exception(String identifier, Object logMessage);
> 
>     /** <p>Log a debug message
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     void debug(String identifier,Object logMessage);
>   }
> 
> 
> 
>   1.1                  jakarta-velocity/src/java/org/apache/velocity/log/LogHandle.java
> 
>   Index: LogHandle.java
>   ===================================================================
>   /* ====================================================================
>    * Copyright (c) iFleet, Inc.  All rights reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. All advertising materials mentioning features or use of this
>    *    software must display the following acknowledgment:
>    *    "This product includes software developed by the Apache Group
>    *    for use in the Apache HTTP server project (http://www.apache.org/)."
>    *
>    * 4. The names "Apache Server" and "Apache Group" must not be used to
>    *    endorse or promote products derived from this software without
>    *    prior written permission. For written permission, please contact
>    *    apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache"
>    *    nor may "Apache" appear in their names without prior written
>    *    permission of the Apache Group.
>    *
>    * 6. Redistributions of any form whatsoever must retain the following
>    *    acknowledgment:
>    *    "This product includes software developed by the Apache Group
>    *    for use in the Apache HTTP server project (http://www.apache.org/)."
>    *
>    * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
>    * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
>    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
>    * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
>    * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
>    * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>    * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
>    * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
>    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
>    * OF THE POSSIBILITY OF SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Group and was originally based
>    * on public domain software written at the National Center for
>    * Supercomputing Applications, University of Illinois, Urbana-Champaign.
>    * For more information on the Apache Group and the Apache HTTP server
>    * project, please see <http://www.apache.org/>.
>    *
>    */
> 
>   package org.apache.velocity.log;
> 
>   /**
>      <p>Handle connected to a {@link org.apache.velocity.Log}
>      to provide identified logging.
> 
>      <p>Typically, a LogHandle should be retrieved from the
>      owning Log object.  A common usage pattern is for each
>      class to contain a static instance of LogHandle, and use
>      the package/classname as the identifier.
>   */
> 
>   public class LogHandle implements java.io.Serializable
>   {
>     public static final int _infoMask = 1;
>     public static final int _warningMask = 2;
>     public static final int _errorMask = 4;
>     public static final int _exceptionMask = 8;
>     public static final int _debugMask = 16;
>     public static final int _noneMask = 0;
>     public static final int _allMask = 255;
> 
>     /** Mask dictating what gets logged */
>     private int         _mask = _allMask;
> 
>     /** Parent 'owning' Log */
>     private Log         _log = null;
> 
>     /** Identifier used during loggin */
>     private String      _identifier = null;
> 
>     /** <p>Construct a LogHandle linked to a particular
>         Log, and tagged with an identifier.
> 
>         @param log The log to delegate to
>         @param identifier The identifier to identify what's getting logged
>     */
> 
>     LogHandle(Log log,
>               String identifier)
>     {
>       _log = log;
>       _identifier = identifier;
>     }
> 
>     /** <p>Set the mask to determine what actually gets logged
>         through this handle.
> 
>         @param mask The bitmask
>     */
>     public void setMask (int mask)
>     {
>         _mask = mask;
>     }
> 
>     /** <p>Retrieve the current bitmask
> 
>         @return bitmask
>      */
>     public int getMask ()
>     {
>         return _mask;
>     }
> 
>     /** <p>Log an informative message
> 
>         @param logMessage The message to log
>     */
>     public void info(Object logMessage)
>     {
>       if ((_mask & _infoMask) != 0)
>         _log.info(_identifier,
>                   logMessage);
>     }
> 
>     /** <p>Log a warning message
> 
>         @param logMessage The message to log
>     */
>     public void warning(Object logMessage)
>     {
>       if ((_mask & _warningMask) != 0)
>         _log.warning(_identifier,
>                      logMessage);
>     }
> 
>     /** <p>Log an error message
> 
>         @param logMessage The message to log
>     */
>     public void error(Object logMessage)
>     {
>       if ((_mask & _errorMask) != 0)
>         _log.error(_identifier,
>                    logMessage);
>     }
> 
>     /** <p>Log an exception (with stacktrace)
> 
>         @param logMessage The message to log
>     */
>     public void exception(Object logMessage)
>     {
>       if ((_mask & _exceptionMask) != 0)
>         _log.exception(_identifier,
>                        logMessage);
>     }
> 
>     /** <p>Log a debug message
> 
>         @param logMessage The message to log
>     */
>     public void debug(Object logMessage)
>     {
>       if ((_mask & _debugMask) != 0)
>         _log.debug(_identifier,
>                    logMessage);
>     }
> 
> 
>   }
> 
> 
> 
> 
>   1.1                  jakarta-velocity/src/java/org/apache/velocity/log/LogImpl.java
> 
>   Index: LogImpl.java
>   ===================================================================
>   /* ====================================================================
>    * Copyright (c) iFleet, Inc.  All rights reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. All advertising materials mentioning features or use of this
>    *    software must display the following acknowledgment:
>    *    "This product includes software developed by the Apache Group
>    *    for use in the Apache HTTP server project (http://www.apache.org/)."
>    *
>    * 4. The names "Apache Server" and "Apache Group" must not be used to
>    *    endorse or promote products derived from this software without
>    *    prior written permission. For written permission, please contact
>    *    apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache"
>    *    nor may "Apache" appear in their names without prior written
>    *    permission of the Apache Group.
>    *
>    * 6. Redistributions of any form whatsoever must retain the following
>    *    acknowledgment:
>    *    "This product includes software developed by the Apache Group
>    *    for use in the Apache HTTP server project (http://www.apache.org/)."
>    *
>    * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
>    * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
>    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
>    * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
>    * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
>    * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>    * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
>    * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
>    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
>    * OF THE POSSIBILITY OF SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Group and was originally based
>    * on public domain software written at the National Center for
>    * Supercomputing Applications, University of Illinois, Urbana-Champaign.
>    * For more information on the Apache Group and the Apache HTTP server
>    * project, please see <http://www.apache.org/>.
>    *
>    */
> 
>   package org.apache.velocity.log;
> 
>   import java.io.*;
>   import java.text.*;
>   import java.util.*;
> 
> 
>   /**
>      <p>Implementation of the Log interface to provide concrete
>      logging facilities
> 
>      <p>Logs thread-id, date, identifier, message, and stack-trace
>      if logging an exception.
>   */
> 
>   public class LogImpl implements Log
>   {
>     /** Format for date logging */
>     static private DateFormat dateFmt = DateFormat.getDateTimeInstance(DateFormat.SHORT,
>                                                                        DateFormat.SHORT);
> 
>     /** Target for this log */
>     private PrintWriter _target  = null;
> 
>     /** Cache of handles (by identifier) */
>     private Hashtable   _handles = new Hashtable();
> 
>     /** Flag dictating if anything gets logged */
>     private boolean quiet_ = (System.getProperty("log.quiet") != null);
> 
>     public LogImpl()
>     {
>       // intentionally left blank
>     }
> 
>     /** Retrieve a LogHandler from this Log matching
>         the identifier
> 
>         @param identifier String to tag message with
>         @return The handle used for logging with the identifier
>     */
>     public synchronized LogHandle getHandle(String identifier)
>     {
>       LogHandle handle = (LogHandle) _handles.get(identifier);
> 
>       if (handle == null)
>       {
>         handle = new LogHandle(this,
>                                identifier);
>         _handles.put(identifier, handle);
>       }
>       return handle;
>     }
> 
>     /** Set the target of this Log
> 
>         If the target is null, then System.err. is used.
> 
>         @param logfile Filename of the logfile
>     */
>     public void setTarget(String logfile) throws IOException
> 
>     {
>       PrintWriter out;
> 
>       if (logfile != null)
>       {
>         out = new PrintWriter(new FileWriter(logfile,true));
>       }
>       else
>       {
>         out = new PrintWriter(new OutputStreamWriter(System.err));
>       }
> 
>       setTarget(out);
> 
>       out.flush();
>     }
> 
>     /** Set the target of this Log
> 
>         If the target is null, then System.err is used.
> 
>         @param target Output sink for log messages
>     */
>     public void setTarget(PrintWriter target) {
> 
>       if (target == null)
>       {
>         target = new PrintWriter(new OutputStreamWriter(System.err));
>       }
> 
>       _target = target;
>       _target.println("------- LOG BEGINS [" + dateFmt.format(new Date()) + "] -------");
>     }
> 
>     private void writeln(String level,
>                          String type,
>                          Object message)
>     {
>       if (!quiet_) {
>         write(level,
>               type,
>               message);
>         _target.println();
>         _target.flush();
>       }
>     }
> 
> 
>     private synchronized void write(String level,
>                                     String type,
>                                     Object message)
>     {
>       try
>       {
>         _target.print( new java.sql.Timestamp(System.currentTimeMillis())
>           + "|" + Thread.currentThread().hashCode()
>                        + "|" + level
>                        + "|" + type
>                        + ": " + message);
>       }
>       catch (java.lang.Exception e)
>       {
>         System.err.println("** COULD NOT WRITE LOG! SWITCHING TO STDERR **");
>         System.err.println(dateFmt.format(new Date())
>                            + "\t" + level + "\t" + message);
>         System.err.flush();
>         setTarget(new PrintWriter(System.err));
>       }
>     }
> 
>     /** <p>Log an informative message
> 
>         @param logMessage The message to log
>     */
>     public void info(String identifier,
>                      Object logMessage)
>     {
>       writeln("INFO",
>               identifier,
>               logMessage);
>     }
> 
>     /** <p>Log a warning message
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     public void warning(String identifier,
>                         Object logMessage)
>     {
>       writeln("WARN",
>               identifier,
>               logMessage);
>     }
> 
>     /** <p>Log an error message
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     public void error(String identifier,
>                       Object logMessage)
>     {
>       writeln("ERROR",
>               identifier,
>               logMessage);
>     }
> 
>     /** <p>Log an exception (with stacktrace)
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     public void exception(String identifier,
>                           Object logMessage)
>     {
>       if (logMessage instanceof Exception) {
>         Exception e = (Exception) logMessage;
>         write("EXCPT",
>               identifier,
>               "");
>         e.printStackTrace(_target);
>         _target.flush();
>       }  else {
>         writeln("EXCPT",
>                 identifier,
>                 logMessage);
>       }
>     }
> 
>     /** <p>Log a debug message
> 
>         @param identifier Identifying tag for message
>         @param logMessage The message to log
>     */
>     public void debug(String identifier,
>                       Object logMessage)
>     {
>       writeln("DEBUG",
>               identifier,
>               logMessage);
>     }
> 
> 
> 
>   }
> 
> 
> 
>   1.1                  jakarta-velocity/src/java/org/apache/velocity/log/Test.java
> 
>   Index: Test.java
>   ===================================================================
> 
>   package org.apache.velocity.log;
> 
>   public class Test
>   {
>         protected LogHandle _log =
>                 Engine.getLogHandle("Foo");
> 
>         public void bar()
>         {
>                 _log.info("bar() called");
>         }
> 
>       public static void main( String [] argv )
>       {
>           Test t = new Test();
>           t.bar();
>       }
>   }
> 
> 
>   class Engine
>   {
>         public static String LOGFILE = "./test.log";
>         protected static LogImpl _logImplementation = null;
> 
>         public static LogHandle getLogHandle( String id )
>         {
>           if( _logImplementation == null )
>               initialize();
>           return _logImplementation.getHandle(id);
>         }
> 
>       private static synchronized void initialize()
>       {
>           try
>           {
>               if( _logImplementation == null )
>               {
>                   _logImplementation = new LogImpl();
>                   _logImplementation.setTarget( LOGFILE );
>               }
>           }
>           catch( java.io.IOException e )
>           {
>               e.printStackTrace();
>           }
>       }
> 
>   }
> 
> 
> 

-- 

Daniel Rall <dl...@collab.net>
http://collab.net/ | open source | do the right thing

Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by bob <bo...@accurev.com>.
> Net result is that Apache looses and this is unlikely to transpire without
> a fight :P.

Yah.

I've inquired with Jon off the list for a final verdict.  I'll
follow whatever he says.  These files definitely are not worth
a fight.

	-bob


Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by Peter Donald <do...@mad.scientist.com>.
Hi,

not sure - recently some one tried to get something in under a dual license
(ie Apache and them) with what I thought was a good reason but the PMC
decided it was too risky to set such a precedent. Thus I doubt very much
that they would be willing to let iFleet hold copyright and keep the code
in CVS.

What would happen if SUN was allowed to keep copyright on tomcat or IBM on
xerces. Apache members would basically be cheap labour. Now if the PMC
allowed you to keep copyright undoubtably these bigger companies who donate
larger code bases and are more influential are going to want same or better.

Net result is that Apache looses and this is unlikely to transpire without
a fight :P.

I know there are projects that keep binary jars of files that they can
redistribute but as far as I know none allow source code with another party
holding the license. 

I may be wrong - I aint anyone important around here :P - but I suspect
trying to do this would not put you in good stead with the powers that be
here.

At 08:46  14/9/00 -0400, you wrote:
>
>I was under the impression that things licensed under the ASF
>license, regardless of who holds the copyright, was compatible
>with ASF projects.
>
>The subsection 'License' from here says:
>
>http://jakarta.apache.org/guidelines/source.html
>
>  All source code committed to the Project's repositories must be covered
>  by the Apache License or contain a copyright and license that allows
>  redistribution under the same conditions as the Apache License.
>
>I think this code still qualifies, even though iFleet holds the
>license.
>
>	-bob
>
>On Thu, 14 Sep 2000 donaldp@mad.scientist.com wrote:
>
>> Hi,
>> 
>> On 13 Sep 2000 werken@locus.apache.org wrote:
>> >   /* ====================================================================
>> >    * Copyright (c) iFleet, Inc.  All rights reserved.
>> >    *
>> 
>> I was under the impression that licenses or copyright like
>> this is not allowed in Apache projects ?
>> 
>> Cheers,
>> 
>> Pete
>> 
>> *--------------------------------------------------*
>> | Latrobe University,     | Does the name 'Pavlov' |
>> | Bundoora, Australia     |    ring a bell ?       |
>> *--------------------------------------------------*
>> 
>
Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by bob <bo...@accurev.com>.
I was under the impression that things licensed under the ASF
license, regardless of who holds the copyright, was compatible
with ASF projects.

The subsection 'License' from here says:

http://jakarta.apache.org/guidelines/source.html

  All source code committed to the Project's repositories must be covered
  by the Apache License or contain a copyright and license that allows
  redistribution under the same conditions as the Apache License.

I think this code still qualifies, even though iFleet holds the
license.

	-bob

On Thu, 14 Sep 2000 donaldp@mad.scientist.com wrote:

> Hi,
> 
> On 13 Sep 2000 werken@locus.apache.org wrote:
> >   /* ====================================================================
> >    * Copyright (c) iFleet, Inc.  All rights reserved.
> >    *
> 
> I was under the impression that licenses or copyright like
> this is not allowed in Apache projects ?
> 
> Cheers,
> 
> Pete
> 
> *--------------------------------------------------*
> | Latrobe University,     | Does the name 'Pavlov' |
> | Bundoora, Australia     |    ring a bell ?       |
> *--------------------------------------------------*
> 


Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by Peter Donald <do...@mad.scientist.com>.
At 09:25  14/9/00 -0400, you wrote:
>> Well there is already a logging toolkit in Avalon code base that is
>> basically equivelent to log4j but better designed - thou I am biased as I
>> am writer :P.
>
>+1
>
>Well, heck, then.  Problem solved. ;)
>
>I think Jason'n'I both decided that log4j was somewhat over-engineered.
>But if the ASF already has something in-use Elsewhere, I could go with
>using it in More Projects.  Commonality is Good.
>
>What's the process for sharing code betwixt projects?  Should Logger
>stuff get carved out into a .jar for inclusion?  I'd hate to just
>copy/paste files around, as it'd make staying in-sync a tad more
>difficult, eh?

when you build Avalon it builds it into a seperate jar (log.jar) which you
can nab. Avalon is going to have a release Real Soon Now (tm) :P so you
could even get it from that.

Eventually I plan to make a proposal for another Apache project - but too
lazy to do that atm :P. Thers another logging toolkit that may be released
under APL at which point then will try and get it going as seperate project
- until then it is probably best just to nab the jar ???

>D'ya have Logger-For-Newbies docs somewhere handy?

Well not exactly - I used but it got lost :P. Basically for clients of
logging system (ie those who want to use it) you just do something like

import org.apache.log.LogKit;
import org.apache.log.Logger;

public class Blah
{
    protected final static boolean              LOG                 = true;
    protected final static boolean              DEBUG               = LOG
&& false;
    protected final static Logger               LOGGER              = 
        ( LOG ) ? LogKit.getLoggerFor( "MyCategory" ) : null;


    public void someMethod()
    {
      if( LOG ) LOGGER.warn("MyWarning", myException );
      if( LOG ) LOGGER.error("this does not compute", myException );
      if( LOG ) LOGGER.info("infomational messages are here" );
      if( LOG ) LOGGER.debug("debug info goes here");
    }

Unfortunately for those who initially setup the server system I removed all
auto-configuration stuff right before I put it in CVS because it was an
ugly hack :P. So the best place to look I guess is in in the configuration
file for Avalon (or specifically chunk I paste below) and the code that
loads configuration data (specifically the file at
http://www.working-dogs.com/cvsweb/index.cgi/framework/src/java/org/apache/a
valon/blocks/logmanager/DefaultLogManager.java). 

Once the initial configuration is set up it is easy as pie - but that first
bit is a little annoying. I really should fix that :P

----------------------------------------------------------------------------
Configuration file chunk.
----------------------------------------------------------------------------
 <global-priority>DEBUG</global-priority> 
  <category name="core_blocks" target="core_blocks" priority="DEBUG" /> 
  <category name="Kernel" target="kernel" priority="DEBUG" /> 
  <category name="Schedular" target="default" priority="WARN" /> 
 <target name="default" class="org.apache.log.output.FileOutputLogTarget">
  <param name="filename" value="../logs/default.log" /> 
 </target>
 
 <target name="kernel" class="org.apache.log.output.FileOutputLogTarget">
   <param name="filename" value="../logs/kernel.log" /> 
   <param name="format" value="[%.14{category}]: %{message}\n" /> 
 </target>
 <target name="core_blocks" class="org.apache.log.output.FileOutputLogTarget">
   <param name="filename" value="../logs/core_blocks.log" /> 
   <param name="format" value="[%.14{category}]: %{message}\n" /> 
  </target>
----------------------------------------------------------------------------
Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/14/2000 6:25 AM, "bob" <bo...@accurev.com> wrote:

>> Well there is already a logging toolkit in Avalon code base that is
>> basically equivelent to log4j but better designed - thou I am biased as I
>> am writer :P.
> 
> +1
> 
> Well, heck, then.  Problem solved. ;)
> 
> I think Jason'n'I both decided that log4j was somewhat over-engineered.
> But if the ASF already has something in-use Elsewhere, I could go with
> using it in More Projects.  Commonality is Good.
> 
> What's the process for sharing code betwixt projects?  Should Logger
> stuff get carved out into a .jar for inclusion?  I'd hate to just
> copy/paste files around, as it'd make staying in-sync a tad more
> difficult, eh?
> 
> D'ya have Logger-For-Newbies docs somewhere handy?
> 
> -bob

+1

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/



Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by bob <bo...@accurev.com>.
> Well there is already a logging toolkit in Avalon code base that is
> basically equivelent to log4j but better designed - thou I am biased as I
> am writer :P.

+1

Well, heck, then.  Problem solved. ;)

I think Jason'n'I both decided that log4j was somewhat over-engineered.
But if the ASF already has something in-use Elsewhere, I could go with
using it in More Projects.  Commonality is Good.

What's the process for sharing code betwixt projects?  Should Logger
stuff get carved out into a .jar for inclusion?  I'd hate to just
copy/paste files around, as it'd make staying in-sync a tad more
difficult, eh?

D'ya have Logger-For-Newbies docs somewhere handy?

	-bob


Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by Peter Donald <do...@mad.scientist.com>.
At 09:05  14/9/00 -0400, you wrote:
>> > I was under the impression that licenses or copyright like
>> > this is not allowed in Apache projects ?
>> 
>> yep. that copyright needs to be removed.
>
>This is donated code from a different project.  iFleet wants to
>keep their copyright, but are happy to license it under an
>ASF-style license.  I wasn't written specifically for Velocity
>or any other ASF project.  
>
>So, if we must remove the copyright, then I'm afraid we must
>remove that code.  (Though, it's not rocket-science code,
>and could easily be duplicated, but, I like to recycle where-
>ever possible).

Well there is already a logging toolkit in Avalon code base that is
basically equivelent to log4j but better designed - thou I am biased as I
am writer :P.

Source tree via webcvs is at
http://www.working-dogs.com/cvsweb/index.cgi/framework/src/java/org/apache/l
og/


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by bob <bo...@accurev.com>.
> > I was under the impression that licenses or copyright like
> > this is not allowed in Apache projects ?
> 
> yep. that copyright needs to be removed.

This is donated code from a different project.  iFleet wants to
keep their copyright, but are happy to license it under an
ASF-style license.  I wasn't written specifically for Velocity
or any other ASF project.  

So, if we must remove the copyright, then I'm afraid we must
remove that code.  (Though, it's not rocket-science code,
and could easily be duplicated, but, I like to recycle where-
ever possible).

	-bob


Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/13/2000 10:43 PM, "donaldp@mad.scientist.com"
<do...@mad.scientist.com> wrote:

> I was under the impression that licenses or copyright like
> this is not allowed in Apache projects ?

yep. that copyright needs to be removed.

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/



Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/log Log.java LogHandle.java LogImpl.java Test.java

Posted by do...@mad.scientist.com.
Hi,

On 13 Sep 2000 werken@locus.apache.org wrote:
>   /* ====================================================================
>    * Copyright (c) iFleet, Inc.  All rights reserved.
>    *

I was under the impression that licenses or copyright like
this is not allowed in Apache projects ?

Cheers,

Pete

*--------------------------------------------------*
| Latrobe University,     | Does the name 'Pavlov' |
| Bundoora, Australia     |    ring a bell ?       |
*--------------------------------------------------*